SCPN1-9601
(cherry picked from commit 9214df8b96ef9f8864bae3d7ab49ca4fdc6f6c43)
This commit is contained in:
parent
9521679a8d
commit
ceb33abfca
@ -4,7 +4,7 @@
|
||||
|
||||
The **HARDIS WMS Connector** is a set of **FreeMarker templates (FTL)** designed to transform **outgoing JSON flows from HARDIS WMS** into **flows compatible with HARDIS SC NETWORK**.
|
||||
|
||||
This connector does not contain any standalone executable code: it is intended to be used by **Reflex integration engines** or **data exchange pipelines**, where it applies the mapping rules defined in the `.ftl` files.
|
||||
This connector does not contain any standalone executable code: it is intended to be used by **HARDIS WMS integration engines** or **data exchange pipelines**, where it applies the mapping rules defined in the `.ftl` files.
|
||||
|
||||
## Role of the FTL Files
|
||||
|
||||
|
||||
11
RFXtoRP_Receipt_ExecutionflowDeleted.ftl
Normal file
11
RFXtoRP_Receipt_ExecutionflowDeleted.ftl
Normal file
@ -0,0 +1,11 @@
|
||||
[
|
||||
{
|
||||
"Header": {
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID": {
|
||||
"RefID": "${id.refid?json_string}"
|
||||
},
|
||||
"Payload": {}
|
||||
}
|
||||
]
|
||||
@ -1,15 +0,0 @@
|
||||
[
|
||||
{
|
||||
"Header": {
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID": {
|
||||
"RefID": "${id.refid?json_string}"
|
||||
},
|
||||
|
||||
"Payload": {
|
||||
"ShipToAcked": true
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
@ -10,8 +10,8 @@
|
||||
|
||||
|
||||
<#assign aDateTime = .now>
|
||||
<#assign no_apiRestReflexID = "no apiRestReflexID">
|
||||
<#assign no_status = -99999>
|
||||
<#assign no_apiRestReflexID = "no apiRestReflexID">
|
||||
<#assign no_status = -99999>
|
||||
|
||||
|
||||
<#switch id.apiRestReflexID!no_apiRestReflexID>
|
||||
@ -30,7 +30,7 @@
|
||||
}
|
||||
]
|
||||
<#break>
|
||||
|
||||
|
||||
<#case "preparation_orders_post">
|
||||
<#switch restResponsetMsg.status!no_status>
|
||||
<#case no_status>
|
||||
@ -54,7 +54,7 @@
|
||||
}
|
||||
]
|
||||
<#break>
|
||||
|
||||
|
||||
<#case 200>
|
||||
<#case 201>
|
||||
<#-- *********************************************** ApiRestID = preparation_orders_post ******************** -->
|
||||
@ -144,7 +144,7 @@
|
||||
}
|
||||
]
|
||||
<#break>
|
||||
|
||||
|
||||
<#case 200>
|
||||
<#case 201>
|
||||
<#-- *********************************************** ApiRestID = receipts_post ******************** -->
|
||||
@ -153,10 +153,10 @@
|
||||
<#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "SUCCESS" >
|
||||
[
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowShipToAcked>
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDeleted>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_Receipt_ShipToAcked.ftl">
|
||||
<#include "RFXtoRP_Receipt_ExecutionflowDeleted.ftl">
|
||||
}
|
||||
]
|
||||
<#else>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<#-- --------------------------------------------------------------------------------------- -->
|
||||
<#-- Concat reflex timestamp with reflex time zone and format this date in ISO UTC format -->
|
||||
<#-- Concat HARDIS WMS timestamp with HARDIS WMS time zone and format this date in ISO UTC format -->
|
||||
<#-- --------------------------------------------------------------------------------------- -->
|
||||
<#function RfxDateTimetoUTC rfxdatetime offset >
|
||||
<#return ((rfxdatetime + offset)?datetime.iso?iso_utc)>
|
||||
@ -10,21 +10,21 @@
|
||||
</#function>
|
||||
|
||||
<#-- --------------------------------------------------------------------------------------- -->
|
||||
<#-- Split email reflex into json array string -->
|
||||
<#-- Split email HARDIS WMS into json array string -->
|
||||
<#-- Example : splitemail "john.doe@hardis-group.com,; name@hardis-group.com" -->
|
||||
<#-- return "["john.doe@hardis-group.com","name@hardis-group.com"]" -->
|
||||
<#-- --------------------------------------------------------------------------------------- -->
|
||||
<#function splitEmailsIntoArray emails >
|
||||
<#local str = "[">
|
||||
<#list emails?split(";|,| |à|/","r")?filter(l -> l != "") as email>
|
||||
<#if email?matches("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$")>
|
||||
<#if str != "[">
|
||||
<#local str += ",">
|
||||
</#if>
|
||||
<#local str += "\"">
|
||||
<#local str += email>
|
||||
<#local str += "\"">
|
||||
</#if>
|
||||
<#if email?matches("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$")>
|
||||
<#if str != "[">
|
||||
<#local str += ",">
|
||||
</#if>
|
||||
<#local str += "\"">
|
||||
<#local str += email>
|
||||
<#local str += "\"">
|
||||
</#if>
|
||||
</#list>
|
||||
<#local str += "]">
|
||||
<#return (str)>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user