diff --git a/RFXtoRP_HsrCarrierApt_SiteCancelAppointment.ftl b/RFXtoRP_HsrCarrierApt_SiteCancelAppointment.ftl deleted file mode 100644 index c4033a6..0000000 --- a/RFXtoRP_HsrCarrierApt_SiteCancelAppointment.ftl +++ /dev/null @@ -1,22 +0,0 @@ -<#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.metadata.last_update_datetime,time_zone_rfx) /> -[ - { - <#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true"> - <#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!=""> - "AppointmentID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}", - <#else> - "AppointmentID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", - - <#else> - <#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!=""> - "AppointmentID": "${carrier_apt.appointment_reference?json_string}", - <#else> - "AppointmentID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", - - - "Header": { - "ProjectID": "${projectRP}" - }, - "ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}" - } -] \ No newline at end of file diff --git a/RFXtoRP_HsrCarrierApt_SiteForceBookAppointment.ftl b/RFXtoRP_HsrCarrierApt_SiteForceBookAppointment.ftl deleted file mode 100644 index a8bdd1f..0000000 --- a/RFXtoRP_HsrCarrierApt_SiteForceBookAppointment.ftl +++ /dev/null @@ -1,156 +0,0 @@ -[ - { - "Header":{ - "ProjectID": "${projectRP}" - }, - "ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}", - <#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true"> - <#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!=""> - "AppointmentID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}", - <#else> - "AppointmentID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", - - <#else> - <#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!=""> - "AppointmentID": "${carrier_apt.appointment_reference?json_string}", - <#else> - "AppointmentID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", - - - "TimeZone":"${time_zone_rfx}", - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false"> - <#if carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-") || carrier_apt.planned_unloading_end_datetime?starts_with("00") || carrier_apt.planned_unloading_end_datetime?contains("-00-")> - <#stop "planned_unloading_start_datetime or planned_unloading_end_datetime field of appointmend is not initialized" > - - <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNLOADING> - <#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_unloading_start_datetime?datetime.iso,carrier_apt.planned_unloading_end_datetime?datetime.iso) /> - <#if (duration <= 0)> - <#stop "planned_unloading_start_datetime or planned_unloading_end_datetime field of appointmend are not valid" > - - <#else> - <#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true" > - <#if carrier_apt.planned_load_start_datetime?starts_with("00") || carrier_apt.planned_load_start_datetime?contains("-00-") || carrier_apt.planned_load_end_datetime?starts_with("00") || carrier_apt.planned_load_end_datetime?contains("-00-")> - <#stop "planned_load_start_datetime or planned_load_end_datetime field of appointmend is not initialized" > - - <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_LOADING> - <#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_load_start_datetime?datetime.iso,carrier_apt.planned_load_end_datetime?datetime.iso) /> - <#if (duration <= 0)> - <#stop "planned_unloading_start_datetime or planned_unloading_end_datetime field of appointmend are not valid" > - - <#else> - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> - <#if carrier_apt.planned_load_end_datetime?starts_with("00") || carrier_apt.planned_load_end_datetime?contains("-00-") || carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-") > - <#stop "planned_unloading_start_datetime or planned_load_end_datetime field of appointmend is not initialized" > - - <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNLOADING> - <#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_unloading_start_datetime?datetime.iso,carrier_apt.planned_load_end_datetime?datetime.iso) /> - <#if (duration <= 0)> - <#stop "planned_unloading_start_datetime or planned_load_end_datetime field of appointmend are not valid" > - - <#else> - <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNKNOWN> - <#assign duration = 0 /> - - - - "AppointmentType": "${appointmentType}", - "Emails": ["${carrier_apt.creation_user_email?json_string}"], - "CustomFields": [ - { - "Key": "depot", - "Value": "${carrier_apt.physical_depot?json_string}" - }, - { - "Key": "year", - "Value": "${carrier_apt.year_number?json_string}" - }, - { - "Key": "number", - "Value": "${carrier_apt.appointment_number?json_string}" - }, - { - "Key": "reference", - "Value": "${carrier_apt.appointment_reference?json_string}" - }, - { - "Key": "carrier", - "Value": "${carrier_apt.planned_carrier?json_string}" - }, - { - "Key": "loading", - "Value": "${carrier_apt.load_appointment?json_string}" - }, - { - "Key": "unloading", - "Value": "${carrier_apt.unloading_appointment?json_string}" - } - ], - <#include "RFXtoRP_HsrCarrierApt_SegmentationSelections.ftl">, - <#include "RFXtoRP_HsrCarrierApt_CarrierInformation.ftl">, - <#include "RFXtoRP_HsrCarrierApt_MetadataAppointment.ftl">, - <#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?filter(l ->l??)?size != 0)> - "Commissions": [ - <#list carrier_apt.physical_receipt_list?filter(l ->l??) as physical_receipt> - { - "ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}", - <#if physical_receipt.physical_receipt_reference?? && physical_receipt.physical_receipt_reference!=""> - "OrderID": "${physical_receipt.physical_receipt_reference?json_string}", - <#else> - "OrderID": "R${carrier_apt.physical_depot?json_string}${physical_receipt.receipt_activity?json_string}${physical_receipt.originator_code?json_string}${physical_receipt.receipt_year}${physical_receipt.receipt_number}", - - "ExecutionflowID": "R${carrier_apt.physical_depot?json_string}${physical_receipt.receipt_activity?json_string}${physical_receipt.originator_code?json_string}${physical_receipt.receipt_year?json_string}${physical_receipt.receipt_number?json_string}", - "ProjectID": "${projectRP}", - <#include "RFXtoRP_HsrCarrierApt_Quantities.ftl"> - }<#sep>, - - ], - <#else> - "Commissions": [ - { - "ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}", - "ProjectID": "${projectRP}", - <#include "RFXtoRP_HsrCarrierApt_Quantities.ftl"> - } - ], - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> - "Reason": "UNLOADING AND LOADING / ${carrier_apt.appointment_designation?json_string}", - <#else> - <#if carrier_apt.appointment_designation?? && carrier_apt.appointment_designation!=""> - "Reason": "${carrier_apt.appointment_designation?json_string}", - <#else> - <#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!=""> - "Reason": "${carrier_apt.appointment_reference?json_string}", - <#else> - "Reason": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", - - - - - "Slots": [{ - <#-- calcul de de la durée en fonction des start et end time--> - "DurationInSeconds": "${duration}", - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false" > - <#if carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-")> - <#stop "planned_unloading_start_datetime field of appointmend is not initialized" > - - "StartDateTime": "${carrier_apt.planned_unloading_start_datetime}" - <#else> - <#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true"> - <#if carrier_apt.planned_load_start_datetime?starts_with("00") || carrier_apt.planned_load_start_datetime?contains("-00-")> - <#stop "planned_load_start_datetime field of appointmend is not initialized" > - - "StartDateTime": "${carrier_apt.planned_load_start_datetime}" - <#else> - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> - <#if carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-")> - <#stop "planned_unloading_start_datetime field of appointmend is not initialized" > - - "StartDateTime": "${carrier_apt.planned_unloading_start_datetime}" - <#else> - <#stop "Appointment type not supported" > - - - - }] - } -] \ No newline at end of file diff --git a/RFXtoRP_HsrCarrierApt_UpdateAppointment.ftl b/RFXtoRP_HsrCarrierApt_UpdateAppointment.ftl deleted file mode 100644 index 2d5cf78..0000000 --- a/RFXtoRP_HsrCarrierApt_UpdateAppointment.ftl +++ /dev/null @@ -1,149 +0,0 @@ -[ - { - <#assign creation_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.metadata.creation_datetime,time_zone_rfx) /> - - "Header":{ - "ProjectID": "${projectRP}" - }, - <#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true"> - <#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!=""> - "AppointmentID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}", - <#else> - "AppointmentID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", - - <#else> - <#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!=""> - "AppointmentID": "${carrier_apt.appointment_reference?json_string}", - <#else> - "AppointmentID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", - - - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false"> - <#if carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-") || carrier_apt.planned_unloading_end_datetime?starts_with("00") || carrier_apt.planned_unloading_end_datetime?contains("-00-")> - <#stop "planned_unloading_start_datetime or planned_unloading_end_datetime field of appointmend is not initialized" > - - <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNLOADING> - <#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_unloading_start_datetime?datetime.iso,carrier_apt.planned_unloading_end_datetime?datetime.iso) /> - <#if (duration <= 0)> - <#stop "planned_unloading_start_datetime or planned_unloading_end_datetime field of appointmend are not valid" > - - <#else> - <#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true" > - <#if carrier_apt.planned_load_start_datetime?starts_with("00") || carrier_apt.planned_load_start_datetime?contains("-00-") || carrier_apt.planned_load_end_datetime?starts_with("00") || carrier_apt.planned_load_end_datetime?contains("-00-")> - <#stop "planned_load_start_datetime or planned_load_end_datetime field of appointmend is not initialized" > - - <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_LOADING> - <#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_load_start_datetime?datetime.iso,carrier_apt.planned_load_end_datetime?datetime.iso) /> - <#if (duration <= 0)> - <#stop "planned_unloading_start_datetime or planned_unloading_end_datetime field of appointmend are not valid" > - - <#else> - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> - <#if carrier_apt.planned_load_end_datetime?starts_with("00") || carrier_apt.planned_load_end_datetime?contains("-00-") || carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-") > - <#stop "planned_unloading_start_datetime or planned_load_end_datetime field of appointmend is not initialized" > - - <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNLOADING> - <#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_unloading_start_datetime?datetime.iso,carrier_apt.planned_load_end_datetime?datetime.iso) /> - <#if (duration <= 0)> - <#stop "planned_unloading_start_datetime or planned_load_end_datetime field of appointmend are not valid" > - - <#else> - <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNKNOWN> - <#assign duration = 0 /> - - - - - "ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}", - "TimeZone":"${time_zone_rfx}", - "CustomFields": [ - { - "Key": "depot", - "Value": "${carrier_apt.physical_depot?json_string}" - }, - { - "Key": "year", - "Value": "${carrier_apt.year_number?json_string}" - }, - { - "Key": "number", - "Value": "${carrier_apt.appointment_number?json_string}" - }, - { - "Key": "reference", - "Value": "${carrier_apt.appointment_reference?json_string}" - }, - { - "Key": "carrier", - "Value": "${carrier_apt.planned_carrier?json_string}" - }, - { - "Key": "loading", - "Value": "${carrier_apt.load_appointment?json_string}" - }, - { - "Key": "unloading", - "Value": "${carrier_apt.unloading_appointment?json_string}" - } - ], - <#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?filter(l ->l??)?size != 0) && ((carrier_apt.unloading_appointment =="true" && carrier_apt.load_appointment =="false") || (carrier_apt.unloading_appointment =="false" && carrier_apt.load_appointment =="true"))> - "Commissions": [ - <#list carrier_apt.physical_receipt_list?filter(l ->l??) as physical_receipt> - { - "ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}", - <#if physical_receipt.physical_receipt_reference?? && physical_receipt.physical_receipt_reference!=""> - "OrderID": "${physical_receipt.physical_receipt_reference?json_string}", - <#else> - "OrderID": "R${carrier_apt.physical_depot?json_string}${physical_receipt.receipt_activity?json_string}${physical_receipt.originator_code?json_string}${physical_receipt.receipt_year}${physical_receipt.receipt_number}", - - "ExecutionflowID": "R${carrier_apt.physical_depot?json_string}${physical_receipt.receipt_activity?json_string}${physical_receipt.originator_code?json_string}${physical_receipt.receipt_year?json_string}${physical_receipt.receipt_number?json_string}", - "ProjectID": "${projectRP}" - }<#sep>, - - ], - <#else> - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> - "Reason": "UNLOADING AND LOADING / ${carrier_apt.appointment_designation?json_string}", - <#else> - <#if carrier_apt.appointment_designation?? && carrier_apt.appointment_designation!=""> - "Reason": "${carrier_apt.appointment_designation?json_string}", - <#else> - <#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!=""> - "Reason": "${carrier_apt.appointment_reference?json_string}", - <#else> - "Reason": "${carrier_apt.year_number}-${carrier_apt.appointment_number}", - - - - - "Slots": [{ - <#-- calcul de de la durée en fonction des start et end time--> - "DurationInSeconds": "${duration}", - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false" > - <#if carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-")> - <#stop "planned_unloading_start_datetime field of appointmend is not initialized" > - - - "StartDateTime": "${carrier_apt.planned_unloading_start_datetime}" - <#else> - <#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true"> - <#if carrier_apt.planned_load_start_datetime?starts_with("00") || carrier_apt.planned_load_start_datetime?contains("-00-")> - <#stop "planned_load_start_datetime field of appointmend is not initialized" > - - "StartDateTime": "${carrier_apt.planned_load_start_datetime}" - <#else> - <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> - <#if carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-")> - <#stop "planned_unloading_start_datetime field of appointmend is not initialized" > - - "StartDateTime": "${carrier_apt.planned_unloading_start_datetime}" - <#else> - <#stop "Appointment type not supported" > - - - - }] - - } -] \ No newline at end of file diff --git a/RFXtoRP_PlatformLogCreate.ftl b/RFXtoRP_PlatformLogCreate.ftl index f48b2b9..e38863f 100644 --- a/RFXtoRP_PlatformLogCreate.ftl +++ b/RFXtoRP_PlatformLogCreate.ftl @@ -1,42 +1,42 @@ -<#include "HfRpConfig.ftl"> -[ - <#assign UUID = UUID.randomUUID()> - <#assign strJsonBody = JsonUtil.espaceQuoteInJsonString(restResponseBody)> - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${UUID}", - "RefDate": { - "DateTime": "${aDateTime?iso_utc}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - "Payload": { - <#assign severity = SeverityLevel.ERROR> - "Severity": "${severity}", - "Namespace": "ReflexIntegration", - "DateTime": { - "DateTime": "${aDateTime?iso_utc}", - "AuthorTimeZone": "${time_zone_rfx}" - }, - "TechMessage": { - "Code": "${restResponsetMsg.status!"no Code"}", - "Label": ${strJsonBody} - }, - "UserMessage": { - "Code": "${restResponsetMsg.status!"no Code"}", - "Label": ${strJsonBody}, - "Params": [] - }, - "DetailElements": [], - "CorrelationID": "${id.correlationid!"no Correlationid"}", - "ContextPayload": ${strJsonBody}, - "Type": "RP_EXECUTIONFLOW_EVENT", - "Task": "${id.apiRestReflexID!"no Task"}", - "OriginalID": "${id.refid!"no OriginalID"?trim?json_string}", - "StackTrace": "" - } - } +<#include "HfRpConfig.ftl"> +[ + <#assign UUID = UUID.randomUUID()> + <#assign strJsonBody = JsonUtil.espaceQuoteInJsonString(restResponseBody)> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${UUID}", + "RefDate": { + "DateTime": "${aDateTime?iso_utc}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload": { + <#assign severity = SeverityLevel.ERROR> + "Severity": "${severity}", + "Namespace": "ReflexIntegration", + "DateTime": { + "DateTime": "${aDateTime?iso_utc}", + "AuthorTimeZone": "${time_zone_rfx}" + }, + "TechMessage": { + "Code": "${restResponsetMsg.status!"no Code"}", + "Label": ${strJsonBody} + }, + "UserMessage": { + "Code": "${restResponsetMsg.status!"no Code"}", + "Label": ${strJsonBody}, + "Params": [] + }, + "DetailElements": [], + "CorrelationID": "${id.correlationid!"no Correlationid"}", + "ContextPayload": ${strJsonBody}, + "Type": ${event}, + "Task": "${id.apiRestReflexID!"no Task"}", + "OriginalID": "${id.refid!"no OriginalID"?trim?json_string}", + "StackTrace": "" + } + } ] \ No newline at end of file diff --git a/RFXtoRP_RestResponse.ftl b/RFXtoRP_RestResponse.ftl index d374992..2a29aeb 100644 --- a/RFXtoRP_RestResponse.ftl +++ b/RFXtoRP_RestResponse.ftl @@ -1,503 +1,521 @@ -<#-- **** 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> -<#-- *********************************************** ApiRestID = preparation_orders_post ******************** --> - <#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> - <#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> -<#-- *********************************************** ApiRestID = receipts_post ******************** --> - <#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> - <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> - <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> - <#if preparationOrderPostResponse.status?? && (preparationOrderPostResponse.status == "SUCCESS" || preparationOrderPostResponse.status == "WARN") > - [ - { - <#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> - <#-- *********************************************** Appointment_post_create ******************** --> - <#case "appointment_post_create"> - <#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.AppointmentAllocationError> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> - } - ] - <#break> - <#case 200> - <#case 201> - <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> - <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> - <#if preparationOrderPostResponse.status?? && (preparationOrderPostResponse.status == "SUCCESS" || preparationOrderPostResponse.status == "WARN") > - [ - { - <#stop > - } - ] - <#else> - [ - { - <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> - <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_PlatformLogCreate.ftl"> - }, - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_RestResponseAppointmentAllocationError.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.AppointmentAllocationError> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> - } - ] - - <#break> - <#-- *********************************************** ApiRestID = appointment_put_update_ref ******************** --> - <#case "appointment_put_update_by_ref"> - <#case "appointment_put_update_by_number"> - <#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.AppointmentAllocationError> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> - } - ] - <#break> - <#case 200> - <#case 201> - <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> - <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> - <#if preparationOrderPostResponse.status?? && (preparationOrderPostResponse.status == "SUCCESS" || preparationOrderPostResponse.status == "WARN") > - [ - { - <#stop > - } - ] - <#else> - [ - { - <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> - <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_PlatformLogCreate.ftl"> - }, - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_RestResponseAppointmentAllocationError.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.AppointmentAllocationError> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> - } - ] - - <#break> - <#-- *********************************************** ApiRestID = canceled ******************** --> - <#case "status_appointment_put_update_by_ref"> - <#case "status_appointment_put_update_by_number"> - <#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.AppointmentAllocationError> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> - } - ] - <#break> - <#case 200> - <#case 201> - <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> - <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> - <#if preparationOrderPostResponse.status?? && (preparationOrderPostResponse.status == "SUCCESS" || preparationOrderPostResponse.status == "WARN") > - [ - { - <#stop > - } - ] - <#else> - [ - { - <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> - <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_PlatformLogCreate.ftl"> - }, - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_RestResponseAppointmentAllocationError.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.AppointmentAllocationError> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> - } - ] - - <#break> - <#-- *********************************************** ApiRestID = appointment_post_physical_receipt_associations ******************** --> - <#case "appointment_post_physical_receipt_associations_by_ref"> - <#case "appointment_post_physical_receipt_associations_by_number"> - <#case "appointment_post_physical_receipt_dissociations_by_ref"> - <#case "appointment_post_physical_receipt_dissociations_by_number"> - <#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.AppointmentAllocationError> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> - } - ] - <#break> - <#case 200> - <#case 201> - <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> - <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> - <#if preparationOrderPostResponse.status?? && (preparationOrderPostResponse.status == "SUCCESS" || preparationOrderPostResponse.status == "WARN") > - [ - { - <#stop > - } - ] - <#else> - [ - { - <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> - <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_PlatformLogCreate.ftl"> - }, - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_RestResponseAppointmentAllocationError.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.AppointmentAllocationError> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> - } - ] - - <#break> -<#-- *********************************************** default ******************** --> - <#default> - <#stop> - - +<#-- **** 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> +<#assign event = "UNKNOW_EVENT" > + +<#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> +<#-- *********************************************** ApiRestID = preparation_orders_post ******************** --> + <#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" : + <#assign event = "RP_EXECUTIONFLOW_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAllocationError.ftl"> + } + ] + <#break> + <#case 200> + <#case 201> + <#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" : + <#assign event = "RP_EXECUTIONFLOW_EVENT"> + <#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" : + <#assign event = "RP_EXECUTIONFLOW_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAllocationError.ftl"> + } + ] + + <#break> +<#-- *********************************************** ApiRestID = receipts_post ******************** --> + <#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" : + <#assign event = "RP_EXECUTIONFLOW_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAllocationError.ftl"> + } + ] + <#break> + <#case 200> + <#case 201> + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> + <#if preparationOrderPostResponse.status?? && (preparationOrderPostResponse.status == "SUCCESS" || preparationOrderPostResponse.status == "WARN") > + [ + { + <#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" : + <#assign event = "RP_EXECUTIONFLOW_EVENT" /> + <#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" : + <#assign event = "RP_EXECUTIONFLOW_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAllocationError.ftl"> + } + ] + + <#break> + <#-- *********************************************** Appointment_post_create ******************** --> + <#case "appointment_post_create"> + <#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" : + <#assign event = "RP_APPOINTMENT_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> + } + ] + <#break> + <#case 200> + <#case 201> + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> + <#if preparationOrderPostResponse.status?? && (preparationOrderPostResponse.status == "SUCCESS" || preparationOrderPostResponse.status == "WARN") > + [ + { + <#stop > + } + ] + <#else> + [ + { + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#assign event = "RP_APPOINTMENT_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAppointmentAllocationError.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" : + <#assign event = "RP_APPOINTMENT_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> + } + ] + + <#break> + <#-- *********************************************** ApiRestID = appointment_put_update_ref ******************** --> + <#case "appointment_put_update_by_ref"> + <#case "appointment_put_update_by_number"> + <#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" : + <#assign event = "RP_APPOINTMENT_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> + } + ] + <#break> + <#case 200> + <#case 201> + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> + <#if preparationOrderPostResponse.status?? && (preparationOrderPostResponse.status == "SUCCESS" || preparationOrderPostResponse.status == "WARN") > + [ + { + <#stop > + } + ] + <#else> + [ + { + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#assign event = "RP_APPOINTMENT_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAppointmentAllocationError.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" : + <#assign event = "RP_APPOINTMENT_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> + } + ] + + <#break> + <#-- *********************************************** ApiRestID = canceled ******************** --> + <#case "status_appointment_put_update_by_ref"> + <#case "status_appointment_put_update_by_number"> + <#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" : + <#assign event = "RP_APPOINTMENT_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> + } + ] + <#break> + <#case 200> + <#case 201> + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> + <#if preparationOrderPostResponse.status?? && (preparationOrderPostResponse.status == "SUCCESS" || preparationOrderPostResponse.status == "WARN") > + [ + { + <#stop > + } + ] + <#else> + [ + { + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#assign event = "RP_APPOINTMENT_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAppointmentAllocationError.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" : + <#assign event = "RP_APPOINTMENT_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> + } + ] + + <#break> + <#-- *********************************************** ApiRestID = appointment_post_physical_receipt_associations/dissociations ******************** --> + <#case "appointment_post_physical_receipt_associations_by_ref"> + <#case "appointment_post_physical_receipt_associations_by_number"> + <#case "appointment_post_physical_receipt_dissociations_by_ref"> + <#case "appointment_post_physical_receipt_dissociations_by_number"> + <#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" : + <#assign event = "RP_APPOINTMENT_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> + } + ] + <#break> + <#case 200> + <#case 201> + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> + <#if preparationOrderPostResponse.status?? && (preparationOrderPostResponse.status == "SUCCESS" || preparationOrderPostResponse.status == "WARN") > + [ + { + <#stop > + } + ] + <#else> + [ + { + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#assign event = "RP_APPOINTMENT_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAppointmentAllocationError.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" : + <#assign event = "RP_APPOINTMENT_EVENT" /> + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAppointmentAllocationError.ftl"> + } + ] + + <#break> +<#-- *********************************************** default ******************** --> + <#default> + <#stop> + +