reflex-wms-connector/RPtoRFX_ExecutionflowEvent.ftl

38 lines
1.4 KiB
Java

<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#assign eventRP = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#switch eventRP.event>
<#case "Created">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign executionflow = eventRP.data />
[
<#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_Preparation_orders_post.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_Receipts_post.ftl">
}
</#if>
]
<#break>
<#default>
<#stop "Event not process">
</#switch>