71 lines
2.3 KiB
Java
71 lines
2.3 KiB
Java
<#-- **** input parameters ***** -->
|
|
<#-- input : message RFX -->
|
|
<#-- project : projectId in ReflexPlatform -->
|
|
<#-- organisation : organisationtId in ReflexPlatform -->
|
|
|
|
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
|
|
<#assign projectRP = project>
|
|
<#assign organisationRP = organisation>
|
|
|
|
<#assign aDateTime = .now>
|
|
|
|
<#switch cloudEventMsg.action>
|
|
<#case "C">
|
|
<#-- *********************************************** Action = CREATE ******************** -->
|
|
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
|
<#assign receipt = JsonUtil.jsonToMap(dataRfx)>
|
|
[
|
|
{
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl">
|
|
|
|
}
|
|
]
|
|
<#break>
|
|
<#case "U">
|
|
<#-- *********************************************** Action = UPDATE ******************** -->
|
|
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
|
<#assign receipt = JsonUtil.jsonToMap(dataRfx)>
|
|
[
|
|
<#if receipt.receipt_confirmed == "true" >
|
|
{
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.ReceiptCompleted>
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl">
|
|
}
|
|
<#else>
|
|
{
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl">
|
|
}
|
|
</#if>
|
|
]
|
|
<#break>
|
|
|
|
<#case "D">
|
|
<#-- *********************************************** Action = DELETE ******************** -->
|
|
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
|
<#assign receipt = JsonUtil.jsonToMap(dataRfx)>
|
|
[
|
|
{
|
|
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl">
|
|
|
|
}
|
|
]
|
|
<#break>
|
|
|
|
|
|
<#default>
|
|
<#stop "event not supported">
|
|
</#switch>
|
|
|