This commit is contained in:
Laurie MONTANT 2024-02-29 11:57:41 +01:00
parent 4193d6e48c
commit da8939ec74

View File

@ -3,7 +3,7 @@
<#-- project : projectId in ReflexPlatform --> <#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project> <#assign projectRP = project>
<#assign organisationRP = organisation> <#assign organisationRP = organisation>
@ -12,82 +12,83 @@
<#switch cloudEventMsg.action> <#switch cloudEventMsg.action>
<#case "C"> <#case "C">
<#-- *********************************************** Action = CREATE ******************** --> <#-- *********************************************** Action = CREATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign receipt = JsonUtil.jsonToMap(dataRfx)>
<#if receipt.receipt_type = "030"> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#stop "ignored message because receipt type = transfert"> <#assign receipt = JsonUtil.jsonToMap(dataRfx)>
<#else> <#if receipt.receipt_reference ?? && receipt.receipt_reference!="">
[ <#if receipt.receipt_type = "030">
{ <#stop "ignored message because receipt type = transfert">
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> <#else>
"apiReflexPlatformID" : "${apiReflexPlatformID}", [
"datas" : {
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
}, "datas" :
{ <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl">
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}", },
"datas" : {
<#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl"> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
} "datas" :
] <#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl">
</#if>
}
]
</#if>
</#if>
<#break> <#break>
<#case "U"> <#case "U">
<#-- *********************************************** Action = UPDATE ******************** --> <#-- *********************************************** Action = UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign receipt = JsonUtil.jsonToMap(dataRfx)> <#assign receipt = JsonUtil.jsonToMap(dataRfx)>
[ [
<#if receipt.receipt_confirmed == "true" > <#if receipt.receipt_confirmed == "true" >
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ReceiptCompleted> <#assign apiReflexPlatformID = ApiReflexPlatformID.ReceiptCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl"> <#include "RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl">
} }
<#else> <#else>
<#if receipt.receipt_type = "030"> <#if receipt.receipt_type = "030">
<#stop "ignored message because receipt type = transfert"> <#stop "ignored message because receipt type = transfert">
<#else> <#else>
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl">
}, },
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl"> <#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl">
} }
</#if> </#if>
</#if> </#if>
] ]
<#break> <#break>
<#case "D"> <#case "D">
<#-- *********************************************** Action = DELETE ******************** --> <#-- *********************************************** Action = DELETE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign receipt = JsonUtil.jsonToMap(dataRfx)> <#assign receipt = JsonUtil.jsonToMap(dataRfx)>
[ [
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl"> <#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl">
} }
] ]
<#break> <#break>
<#default> <#default>
<#stop "event not supported"> <#stop "event not supported">
</#switch> </#switch>