This commit is contained in:
Laurie MONTANT 2024-09-26 16:09:30 +02:00
commit 138bcdadf8
3 changed files with 77 additions and 16 deletions

View File

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

View File

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

View File

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