<#-- **** input parameters ***** --> <#-- input : Response message from HARDIS WMS --> <#-- project : projectId in HARDIS SC NETWORK --> <#-- organisation : organisationtId in HARDIS SC NETWORK --> <#assign restResponsetMsg = JsonUtil.jsonToMap(input)> <#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!no_apiRestReflexID> <#case no_apiRestReflexID> [ { <#if restResponsetMsg.body?? > <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#else> <#assign restResponseBody = "${restResponsetMsg?trim?json_string}" /> <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_PlatformLogCreate.ftl"> } ] <#break> <#case "preparation_orders_post"> <#switch restResponsetMsg.status!no_status> <#case no_status> [ { <#if restResponsetMsg.body?? > <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#else> <#assign restResponseBody = "${restResponsetMsg?trim?json_string}" /> <#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 ******************** --> <#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> <#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "WARN"> [ { <#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 = "${restResponsetMsg?trim?json_string}}" /> <#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!no_status> <#case no_status> [ { <#if restResponsetMsg.body?? > <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#else> <#assign restResponseBody = "${restResponsetMsg?trim?json_string}" /> <#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 ******************** --> <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> <#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "SUCCESS" > [ { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDeleted> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_Receipt_ExecutionflowDeleted.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 = "${restResponsetMsg?trim?json_string}" /> <#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>