输入JSON
{
"digital-profiles": [{
"Id": "INTID1",
"status": "ACTIVE",
"cId": "12"
},
{
"dId": "INTID2",
"status": "barred",
"cId": "13"
},
{
"Id": "INTID3",
"status": "ACTIVE",
"cId": "14"
}
]
}
输出:
{
"Results": {
"NewId": "INTID1:ACTIVE,INTID2:barred,INTID3:ACTIVE"
}
}
我正在尝试使用上面提到的输入来实现上面提到的输出JSON。如何使用dataweave转换实现此目的。任何帮助将不胜感激。
答案 0 :(得分:3)
%dw 1.0
%output application/json
---
Results : {
NewId : payload.digital-profiles map ($.Id ++ ':' ++ $.status) joinBy ','
}
希望这有帮助。
答案 1 :(得分:-2)
这是你可以做到的一种方式(代码未经过测试,但目前处理非常相似的事情)
flag = {};
flag.is_open = false;
$("#open-modal").on("click", function(){
if(!flag.is_open){ // so at first click result is true
#ajax request
#modal creation
flag.is_open = true; // when user click second time you wont send ajax
}
});
// and when u close
$("#close-modal").on("click", function(){
if(flag.is_open){ // it is open
#modal-destruction
flag.is_open = false;
}
});