61 lines
2.0 KiB
Java
61 lines
2.0 KiB
Java
<#-- **** input parameters ***** -->
|
|
<#-- input : message RFX -->
|
|
<#-- project : projectId in ReflexPlatform -->
|
|
<#-- organisation : organisationtId in ReflexPlatform -->
|
|
<#-- sum_elt : nb element in snapshot (optional parameter) -->
|
|
|
|
<#include "HfRpConfig.ftl">
|
|
|
|
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
|
|
<#assign projectRP = project>
|
|
<#assign organisationRP = organisation>
|
|
|
|
<#switch cloudEventMsg.action>
|
|
<#case "C">
|
|
<#case "U">
|
|
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
|
|
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
|
<#assign reflexStockPicturesInterface = JsonUtil.jsonToMap(dataRfx)>
|
|
|
|
<#-- idSnapshot MUST BE UNIQUE regardless of the number of messages in the stock image -->
|
|
<#if cloudEventMsg.messageSet??>
|
|
<#assign idSnapshot = cloudEventMsg.messageSet />
|
|
<#else>
|
|
<#assign idSnapshot = cloudEventMsg.id />
|
|
</#if>
|
|
|
|
<#list reflexStockPicturesInterface.detailled_stock_list as stock>
|
|
<#if stock.stock_type_code != "200">
|
|
<#stop>
|
|
<#break>
|
|
</#if>
|
|
</#list>
|
|
[
|
|
{
|
|
<#if sum_elt??>
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.ActorSnapshotCompleted>
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl">
|
|
<#else>
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.StockSnapshotted>
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl">
|
|
</#if>
|
|
}
|
|
]
|
|
|
|
<#break>
|
|
|
|
<#case "D">
|
|
<#-- *********************************************** Action = DELETE ******************** -->
|
|
<#stop >
|
|
<#break>
|
|
|
|
|
|
<#default>
|
|
<#stop >
|
|
</#switch>
|
|
|