If / else statements work considerably differently in dataweave 1.0, update
doesn't exist, and I don't know if isEmpty
exists as part of core - don't think so. If you know ahead of time the structure of the object, you can simply build a new object like this:
%dw 1.0
%input payload application/json
%output application/json
---
payload when (payload.sets.exd.cse.doa != '' and payload.sets.exd.cse.doa != null)
otherwise {
sets: {
exd: {
cse: {
data: "test"
}
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…