[英]Transform JSONArray values in WSO2 EI
我在 wso2 EI 的调解期间有一些转换逻辑。 我在"@type":"Lead" 转换为 "attributes":{"type":"Lead"}转换时卡住了。
注意:我知道使用 payloadfactory 来实现这一点(预期格式)。 在 getFields 数组下收到至少 1000 个 JSONObject。
输入:
{
"getDataResponse":{
"result":{
"DataSyncTime":"sometime",
"getFields":[
{
"@type":"Lead",
"FirstName":"Justin"
},
{
"@type":"Lead",
"FirstName":"Manoj"
}
//received atleast 1000 records ie jsonobject here(Dynamic)
],
"Message" :"Text messsage",
"Success":200
}
}
}
预期的:
{
"DataSyncTime":"sometime",
"getEvents":[],
"getFields":[
{
"attributes":{"type":"Lead"},
"FirstName":"Justin"
},
{
"attributes":{"type":"Lead"},
"FirstName":"Manoj"
}
],
"getTask":[],
"Message" :"Text messsage",
"Success":200
}
尝试使用 Foreach 调解器和 Payload Factory 调解器来循环遍历数组。 如果 Payload Factory 不能满足您的要求,您可能必须使用自定义类中介来实现您的要求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.