reflex-wms-connector/RPtoRFX_ExecutionflowEvent.ftl
2024-03-13 18:07:47 +01:00

52 lines
1.8 KiB
Java

<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#assign eventRP = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#-- initialisation map for SegmentationKey and MetaData -->
<#assign Header_MetaData_Map = {} />
<#assign SegmentationKeys_Map = {} />
<#assign Line_MetaData_Map = {} />
<#switch eventRP.event>
<#case "Created">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign executionflow = eventRP.data />
<#-- ******* Header MetaData to maps ******** -->
<#if executionflow.MetaData??>
<#assign Header_MetaData_Map = JsonUtil.sequenceToMap(executionflow.MetaData, "Key", "Value") />
</#if>
[
<#if eventRP.partnerAppRole == "ShipFrom" && executionflow.ShipFrom.ActorID != "" && executionflow.ShipFrom.Actor.IsShipFromConnected?? && executionflow.ShipFrom.Actor.IsShipFromConnected>
{
<#assign apiRestReflexID = ApiRestReflexID.preparation_orders_post>
"apiRestReflexID" : "${apiRestReflexID}",
"datas" :
<#include "RPtoRFX_PrepOrder.ftl">
}
</#if>
<#if eventRP.partnerAppRole == "ShipTo" && executionflow.ShipTo.ActorID != "" && executionflow.ShipTo.Actor.IsShipToConnected?? && executionflow.ShipTo.Actor.IsShipToConnected>
{
<#assign apiRestReflexID = ApiRestReflexID.receipts_post>
"apiRestReflexID" : "${apiRestReflexID}",
"datas" :
<#include "RPtoRFX_Receipt.ftl">
}
</#if>
]
<#break>
<#default>
<#stop "Event not processed">
</#switch>