<#-- **** input parameters ***** --> <#-- input : Response message from Reflex --> <#-- project : projectId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform --> <#assign restResponsetMsg = JsonUtil.jsonToMap(input)> <#assign id = JsonUtil.jsonToMap(restResponsetMsg.id)> <#assign projectRP = project> <#assign organisationRP = organisation> <#assign aDateTime = .now> <#switch id.apiRestReflexID> <#case "preparation_orders_post"> <#switch restResponsetMsg.status> <#case 200> <#case 201> <#-- *********************************************** ApiRestID = preparation_orders_post ******************** --> <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> <#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "SUCCESS" > [ { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowShipFromAcked> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_PrepOrder_ShipFromAcked.ftl"> } ] <#else> [ { <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_RestResponseAllocationError.ftl"> } ] <#break> <#default> [ { <#if restResponsetMsg.body?? > <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#else> <#assign restResponseBody = "{}" /> <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_RestResponseAllocationError.ftl"> } ] <#break> <#case "receipts_post"> <#switch restResponsetMsg.status> <#case 200> <#case 201> <#-- *********************************************** ApiRestID = receipts_post ******************** --> <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> <#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "SUCCESS" > [ { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowShipToAcked> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_Receipt_ShipToAcked.ftl"> } ] <#else> [ { <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_RestResponseAllocationError.ftl"> } ] <#break> <#default> [ { <#if restResponsetMsg.body?? > <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#else> <#assign restResponseBody = "{}" /> <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_PlatformLogCreate.ftl"> }, { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_RestResponseAllocationError.ftl"> } ] <#break> <#default> <#stop>