I've currently got a working Transform Message
(DataWeave) component in my Mule Project; which returns valid JSON.
What I need now is to update and add to that transformation with additional info from a second (and sometimes more) database payload(s).
I know that you can specify many inputs in the dw script (See DW example tutorial).
%dw 1.0
%input in0 application/json
%input in1 application/json
%input in2 application/json
%output application/xml
[where in0, in1 and in2 are actual input names]
I'm not sure how to apply this method to multiple payloads derived from the database.
My aim is to have my base JSON be built by the first payload:
{
"code": "some code",
"title": "some title",
"description": "some description",
"keywords": []
}
which works fine.
But now I want the keywords array to be populated by the next payload, to become:
{
"code": "some code",
"title": "some title",
"description": "some description",
"keywords": [
"keyword 1", "keyword 2", "keyword x"
]
}
How to I map a JSON output in DataWeave from multiple inputs?
Details:
- Mule EE Version: 3.7.2
- Anypoint Studio Version: 5.3.0
Payload
object? – Möoz