SCPN1-7088

This commit is contained in:
Francis REAT 2024-09-20 17:22:27 +02:00
parent 307ae9ebe2
commit 360c0743bc
3 changed files with 77 additions and 16 deletions

View File

@ -22,22 +22,21 @@
"AuthorTimeZone": "${time_zone_rfx}"
},
"TechMessage": {
"Code": "${restResponsetMsg.status}",
"Code": "${restResponsetMsg.status!"no Code"}",
"Label": ${strJsonBody}
},
"UserMessage": {
"Code": "${restResponsetMsg.status}",
"Code": "${restResponsetMsg.status!"no Code"}",
"Label": ${strJsonBody},
"Params": []
},
"DetailElements": [],
"CorrelationID": "${id.correlationid}",
"ContextPayload": "rfxresponse",
"CorrelationID": "${id.correlationid!"no Correlationid"}",
"ContextPayload": ${strJsonBody},
"Type": "RP_EXECUTIONFLOW_EVENT",
"Task": "${id.apiRestReflexID}",
"OriginalID": "${id.refid?trim?json_string}",
"Task": "${id.apiRestReflexID!"no Task"}",
"OriginalID": "${id.refid!"no OriginalID"?trim?json_string}",
"StackTrace": ""
}
}
]
]

View File

@ -4,16 +4,57 @@
<#-- organisation : organisationtId in ReflexPlatform -->
<#assign restResponsetMsg = JsonUtil.jsonToMap(input)>
<#assign id = JsonUtil.jsonToMap(restResponsetMsg.id)>
<#assign id = JsonUtil.jsonToMap(restResponsetMsg.id!"{}")>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#assign no_apiRestReflexID = "no apiRestReflexID">
<#assign no_status = -99999>
<#switch id.apiRestReflexID>
<#switch id.apiRestReflexID!no_apiRestReflexID>
<#case no_apiRestReflexID>
[
{
<#if restResponsetMsg.body?? >
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#else>
<#assign restResponseBody = "${restResponsetMsg?trim?json_string}" />
</#if>
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl">
}
]
<#break>
<#case "preparation_orders_post">
<#switch restResponsetMsg.status>
<#switch restResponsetMsg.status!no_status>
<#case no_status>
[
{
<#if restResponsetMsg.body?? >
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#else>
<#assign restResponseBody = "${restResponsetMsg?trim?json_string}" />
</#if>
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_RestResponseAllocationError.ftl">
}
]
<#break>
<#case 200>
<#case 201>
<#-- *********************************************** ApiRestID = preparation_orders_post ******************** -->
@ -63,7 +104,7 @@
<#if restResponsetMsg.body?? >
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#else>
<#assign restResponseBody = "{}" />
<#assign restResponseBody = "${restResponsetMsg?trim?json_string}}" />
</#if>
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
@ -81,7 +122,29 @@
<#break>
<#case "receipts_post">
<#switch restResponsetMsg.status>
<#switch restResponsetMsg.status!no_status>
<#case no_status>
[
{
<#if restResponsetMsg.body?? >
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#else>
<#assign restResponseBody = "${restResponsetMsg?trim?json_string}" />
</#if>
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_RestResponseAllocationError.ftl">
}
]
<#break>
<#case 200>
<#case 201>
<#-- *********************************************** ApiRestID = receipts_post ******************** -->
@ -121,7 +184,7 @@
<#if restResponsetMsg.body?? >
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#else>
<#assign restResponseBody = "{}" />
<#assign restResponseBody = "${restResponsetMsg?trim?json_string}" />
</#if>
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
@ -137,7 +200,6 @@
]
</#switch>
<#break>
<#default>
<#stop>
</#switch>

View File

@ -7,7 +7,7 @@
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${id.refid?trim?json_string}",
"RefID": "${id.refid!"no RefID"?trim?json_string}",
"RefDate": {
"DateTime": "${aDateTime?iso_utc}",
"AuthorTimeZone": "${time_zone_rfx}"