From 8229616050eda8e6f69bcdf59ec635dbe4b51692 Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Mon, 16 Jun 2025 10:52:41 +0200 Subject: [PATCH] SCPN1-8870 --- RFXtoRP_HsrPro.ftl | 8 -------- RFXtoRP_HsrPro_ExecutionflowCancelled.ftl | 6 +++++- RFXtoRP_HsrPro_ExecutionflowDetected.ftl | 12 ++++++++++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/RFXtoRP_HsrPro.ftl b/RFXtoRP_HsrPro.ftl index 1ef9917..5bf0bcd 100644 --- a/RFXtoRP_HsrPro.ftl +++ b/RFXtoRP_HsrPro.ftl @@ -17,7 +17,6 @@ <#assign preparation_order = JsonUtil.jsonToMap(dataRfx)> [ - <#if preparation_order.originator_reference?? && preparation_order.originator_reference!=""> <#-- check preparation type code (internal order and reservation are ignored) --> <#if preparation_order.preparation_type_code == "010" || preparation_order.preparation_type_code == "030"> <#-- Only if preparation order not confirmed --> @@ -37,9 +36,6 @@ <#-- preparation order type not supported --> <#stop> - <#else> - <#stop "PRO reference is empty"> - ] <#break> @@ -48,16 +44,12 @@ <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign preparation_order = JsonUtil.jsonToMap(dataRfx)> [ - <#if preparation_order.originator_reference?? && preparation_order.originator_reference!=""> { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrPro_ExecutionflowCancelled.ftl"> } - <#else> - <#stop "PRO reference is empty"> - ] <#break> diff --git a/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl b/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl index b518fa7..c42aa61 100644 --- a/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl @@ -7,7 +7,11 @@ "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${preparation_order.originator_reference?trim?json_string}", + <#if preparation_order.originator_reference?? && preparation_order.originator_reference!=""> + "RefID": "${preparation_order.originator_reference?trim?json_string}", + <#else> + "RefID": "${preparation_order.physical_depot_code}${preparation_order.activity_code}${preparation_order.originator_code}${preparation_order.preparation_order_year}${preparation_order.preparation_order_number}", + "RefDate": { "DateTime": "${preparation_status_datetime}", "AuthorTimeZone": "${time_zone_rfx}" diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl index ee97306..08d8213 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl @@ -9,7 +9,11 @@ "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${preparation_order.originator_reference?trim?json_string}", + <#if preparation_order.originator_reference?? && preparation_order.originator_reference!=""> + "RefID": "${preparation_order.originator_reference?trim?json_string}", + <#else> + "RefID": "${preparation_order.physical_depot_code}${preparation_order.activity_code}${preparation_order.originator_code}${preparation_order.preparation_order_year}${preparation_order.preparation_order_number}", + "RefDate": { "DateTime": "${pro_creation_datetime}", "AuthorTimeZone": "${time_zone_rfx}" @@ -78,7 +82,11 @@ } }, - + <#if preparation_order.originator_reference?? && preparation_order.originator_reference!=""> + "OrderID": "${preparation_order.originator_reference?trim?json_string}", + <#else> + "OrderID": "${preparation_order.physical_depot_code}${preparation_order.activity_code}${preparation_order.originator_code}${preparation_order.preparation_order_year}${preparation_order.preparation_order_number}", + <#if preparation_order.line_list??> "Lines" : [ <#list preparation_order.line_list as preparation_order_line >