You've already forked reflex-wms-connector
51 lines
1.7 KiB
Java
51 lines
1.7 KiB
Java
<#include "HfRpConfig.ftl">
|
|
[
|
|
<#assign UUID = UUID.randomUUID()>
|
|
<#assign strJsonBody = JsonUtil.espaceQuoteInJsonString(restResponseBody)?replace("\n", "")?replace("\r", "")>
|
|
<#assign maxLen = 32000>
|
|
<#if strJsonBody?length gt maxLen>
|
|
<#assign strJsonBody = JsonUtil.espaceQuoteInJsonString(restResponseBody)?replace("\n", "")?replace("\r", "")?replace('"logical_key_list"\\s*:\\s*\\[[^\\]]*\\]', '"logical_key_list": []', 'r')>
|
|
</#if>
|
|
<#if strJsonBody?length gt maxLen>
|
|
<#assign safeJsonBody = "{\"truncated\": true, \"original_size\": " + strJsonBody?length + "}">
|
|
<#else>
|
|
<#assign safeJsonBody = strJsonBody>
|
|
</#if>
|
|
{
|
|
"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": "${safeJsonBody?json_string}"
|
|
},
|
|
"UserMessage": {
|
|
"Code": "${restResponsetMsg.status!"no Code"}",
|
|
"Label": "${safeJsonBody?json_string}",
|
|
"Params": []
|
|
},
|
|
"DetailElements": [],
|
|
"CorrelationID": "${id.correlationid!"no Correlationid"}",
|
|
"ContextPayload": "${safeJsonBody?json_string}",
|
|
"Type": "${event}",
|
|
"Task": "${id.apiRestReflexID!"no Task"}",
|
|
"OriginalID": "${id.refid!"no OriginalID"?trim?json_string}",
|
|
"StackTrace": ""
|
|
}
|
|
}
|
|
] |