In the example below, When I create variable in Transform, I sometimes use application/java and some times use application/json . It seems that the target system using this variable doesn't care whether the output is JSON or Java. Only in a few cases does it matter. My gut feeling is that the Mule platform will automatically convert it to the proper type, even if you set it incorrectly.
My question is: In which situations should I use output application/java or output application/json? Is there a general rule to follow?
Any suggestion or ideas are more than weclome!
%dw 2.0
output application/java
---
{
companyCode: attributes.queryParams.companyCode,
((updSince: attributes.queryParams.updSince)) if(!isEmpty(attributes.queryParams.updSince)),
((updBefore: attributes.queryParams.updBefore)) if(!isEmpty(attributes.queryParams.updBefore)),
((updDate: attributes.queryParams.updDate)) if(!isEmpty(attributes.queryParams.updDate)),
limit: attributes.queryParams.limit as Number default 200,
page: attributes.queryParams.page as Number default 1
}
