Home United States USA — software Parse Template Transformer in Mule Parse Template Transformer in Mule

Parse Template Transformer in Mule Parse Template Transformer in Mule

681
0
SHARE

The Parse Template component loads a file into the Mule payload. Learn how to use it and see several use cases, then see an example request and response.
The Parse Template component loads a file into the Mule payload. The ‘Parse Template’ transformer parses a template file that can contain MEL expressions and places the resulting string into the message payload. We can use the payload, flowVars and inboundproperties in the template to create the dynamic content.
# [message.inboundProperties.’http.query.params’.name]
# [flowVars.accountNumber]
# [payload [0] [‘order_no’] ]
Let’s walk through how to use JSON Schema validator in Mule application. In this example, we are receiving the order through HTTP call from the end user. We are using a parse template to load a file from an external location – a file which, behaving as a template, expects values for « order number,  » « order description,  » and « order provisioning date. » The parse template extracts info from the Mule message variables to insert as values into the template and set the resulting contents as the message payload.
To execute this flow, we will have to open the REST client and pass the payload as part of the POST request body. Below are the screenshots of the request and response.
Request:
Hope this helps.
Thanks.
Keep learning.

Continue reading...