SlideShare a Scribd company logo
Using Parse Template
Component
- By Rahul Kumar
Parse Template Component
Use a parse template to load the content of a flow-external file into a Mule flow,
then use the file as a template into which you can insert data returned as the
result of evaluated Mule expressions.
Groovy also allows the developer to configure interceptors and alter the values
or references of particular properties in a script. Interceptors are configured to
provide additional services to a message as it flows through a component
Parse Template Component
For example, perhaps you want a Mule flow to send an "order complete" HTTP response to a
caller to indicate the new order’s number and the number of widgets ordered (both values that
you previously set on the Mule message as variables). You can use a parse template to load a
file from an external location – a file which, behaving as a template, expects values for "order
number" and "number of widgets". Then, 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. In essence, a parse template pulls a template file into a Mule flow, fills in the
blanks, then sets results on the message as the payload. In the example, after the parse
template sets the payload on the message using the external file as a template, the Mule flow
returns the HTTP response to confirm the order
Configuratio :
Location : Define the location of the file that Mule uses as a template into
which to insert values extracted from the message properties or variables.
Examples
<html>
<body>
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Department</th>
<th>Job Title</th>
<th>Start Date</th>
<th>Employee Type</th>
</tr>
<tr>
<td>#[payload[0]['first_name']]</td>
<td>#[payload[0]['last_name']]</td>
<td>#[payload[0]['department']]</td>
<td>#[payload[0]['job_title']]</td>
<td>#[payload[0]['start_date']]</td>
<td>#[payload[0]['employee_type']]</td>
Examples
<flow name="exampleTemplateFlow1" >
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"
doc:description="Send GET request with a parameter, for example,
http://localhost:8081/getEmployee?id=12345"/>
<jdbc-ee:outbound-endpoint exchange-pattern="request-response"
queryKey="getEmployeeById" queryTimeout="-1" connector-ref="Database"
doc:name="Database" doc:description="Returns list of maps containing records; only the first
one is required."/>
<parse-template location="src/test/resources/responseHtml.template" doc:name="Parse
Template"/>
<set-property doc:name="Content Type" propertyName="Content-Type" value="text/html"/>
</flow>
Examples
To use the application in this example, you must send an HTTP request with a URL that
includes an id query parameter, such as http://localhost:8081/getEmployee?id=12345.
Dynamic HTML is returned according to the Mule expressions in the template
Thank You !!
Ad

More Related Content

What's hot (17)

Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data Weave
Mohammed246
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
AnilKumar Etagowni
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
Rajkattamuri
 
Mule introduction
Mule introductionMule introduction
Mule introduction
Satya Sekhar Das Mandal
 
Using XSLT in Mule
Using XSLT in MuleUsing XSLT in Mule
Using XSLT in Mule
Anirban Sen Chowdhary
 
Mule esb
Mule esbMule esb
Mule esb
Khan625
 
Mule accessing multiple database in parallel
Mule accessing multiple database in parallelMule accessing multiple database in parallel
Mule accessing multiple database in parallel
Anirban Sen Chowdhary
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
Mohammed246
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mule
javeed_mhd
 
Mule property placeholder
Mule property placeholderMule property placeholder
Mule property placeholder
Sashidhar Rao GDS
 
Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)
Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)
Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)
Jitendra Bafna
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
Khan625
 
xslt in mule
xslt in mulexslt in mule
xslt in mule
Praneethchampion
 
MuleSoft ESB Message Enricher
MuleSoft ESB Message Enricher MuleSoft ESB Message Enricher
MuleSoft ESB Message Enricher
akashdprajapati
 
File component in mule
File component in muleFile component in mule
File component in mule
Rajkattamuri
 
Parameters as a part of body
Parameters as a part of bodyParameters as a part of body
Parameters as a part of body
Anirban Sen Chowdhary
 
Xslt with mule
Xslt with muleXslt with mule
Xslt with mule
Son Nguyen
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data Weave
Mohammed246
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
Rajkattamuri
 
Mule esb
Mule esbMule esb
Mule esb
Khan625
 
Mule accessing multiple database in parallel
Mule accessing multiple database in parallelMule accessing multiple database in parallel
Mule accessing multiple database in parallel
Anirban Sen Chowdhary
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
Mohammed246
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mule
javeed_mhd
 
Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)
Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)
Connecting To MS SQL Server With Mulesoft (Stored Procedure To Insert data)
Jitendra Bafna
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
Khan625
 
MuleSoft ESB Message Enricher
MuleSoft ESB Message Enricher MuleSoft ESB Message Enricher
MuleSoft ESB Message Enricher
akashdprajapati
 
File component in mule
File component in muleFile component in mule
File component in mule
Rajkattamuri
 
Xslt with mule
Xslt with muleXslt with mule
Xslt with mule
Son Nguyen
 

Similar to Using parse template component (20)

Parse template transformer mule
Parse template transformer muleParse template transformer mule
Parse template transformer mule
Ankit Lawaniya
 
Mule connectors-session1
Mule connectors-session1Mule connectors-session1
Mule connectors-session1
Vishnukanth Rachineni
 
Mule connectors-part 1
Mule connectors-part 1Mule connectors-part 1
Mule connectors-part 1
VirtusaPolaris
 
Mule ESB Components
Mule ESB Components Mule ESB Components
Mule ESB Components
pat_91
 
Elements in a muleflow
Elements in a muleflowElements in a muleflow
Elements in a muleflow
Thang Loi
 
Mule concepts
Mule conceptsMule concepts
Mule concepts
Sindhu VL
 
Elements in a mule flow
Elements in a mule flowElements in a mule flow
Elements in a mule flow
Sindhu VL
 
Mule esb
Mule esbMule esb
Mule esb
vishnukanthro45
 
Mule esb
Mule esbMule esb
Mule esb
charan teja R
 
Maven tools & archetypes
Maven tools & archetypesMaven tools & archetypes
Maven tools & archetypes
Son Nguyen
 
Mule advanced
Mule advancedMule advanced
Mule advanced
D.Rajesh Kumar
 
WEB DESIGNING.pdf
WEB DESIGNING.pdfWEB DESIGNING.pdf
WEB DESIGNING.pdf
Prof. Dr. K. Adisesha
 
HTML - LinkedIn
HTML - LinkedInHTML - LinkedIn
HTML - LinkedIn
Gino Louie Peña, ITIL®,MOS®
 
Web designing
Web designingWeb designing
Web designing
Prof. Dr. K. Adisesha
 
HTML/HTML5
HTML/HTML5HTML/HTML5
HTML/HTML5
People Strategists
 
HTML Foundations, pt 2
HTML Foundations, pt 2HTML Foundations, pt 2
HTML Foundations, pt 2
Shawn Calvert
 
331592291-HTML-and-Cascading style sheet
331592291-HTML-and-Cascading style sheet331592291-HTML-and-Cascading style sheet
331592291-HTML-and-Cascading style sheet
stephen972973
 
Mule ESB Interview or Certification questions
Mule ESB Interview or Certification questionsMule ESB Interview or Certification questions
Mule ESB Interview or Certification questions
TechieVarsity
 
Mule ESB
Mule ESBMule ESB
Mule ESB
Yura Nosenko
 
Data weave
Data weave Data weave
Data weave
Khasim Saheb
 
Ad

More from Rahul Kumar (20)

Combine collections transformer
Combine collections transformerCombine collections transformer
Combine collections transformer
Rahul Kumar
 
Creating global functions
Creating global functionsCreating global functions
Creating global functions
Rahul Kumar
 
Creating custom object store
Creating custom object storeCreating custom object store
Creating custom object store
Rahul Kumar
 
Using expression component
Using expression componentUsing expression component
Using expression component
Rahul Kumar
 
Creating custom transformer
Creating custom transformerCreating custom transformer
Creating custom transformer
Rahul Kumar
 
Creating custom aggregation strategy
Creating custom aggregation strategyCreating custom aggregation strategy
Creating custom aggregation strategy
Rahul Kumar
 
Creating custom aggregator
Creating custom aggregatorCreating custom aggregator
Creating custom aggregator
Rahul Kumar
 
Byte array to hex string transformer
Byte array to hex string transformerByte array to hex string transformer
Byte array to hex string transformer
Rahul Kumar
 
Creating custom filter
Creating custom filterCreating custom filter
Creating custom filter
Rahul Kumar
 
Hex string to byte array transformer
Hex string to byte array transformerHex string to byte array transformer
Hex string to byte array transformer
Rahul Kumar
 
XML to DOM Transformer
XML to DOM TransformerXML to DOM Transformer
XML to DOM Transformer
Rahul Kumar
 
Dom to xml transformer
Dom to xml transformerDom to xml transformer
Dom to xml transformer
Rahul Kumar
 
Object to input stream transformer
Object to input stream transformerObject to input stream transformer
Object to input stream transformer
Rahul Kumar
 
Byte array to object transformer
Byte array to object transformerByte array to object transformer
Byte array to object transformer
Rahul Kumar
 
Byte array to string transformer
Byte array to string transformerByte array to string transformer
Byte array to string transformer
Rahul Kumar
 
Object to string transformer
Object to string transformerObject to string transformer
Object to string transformer
Rahul Kumar
 
Csv to json transform in simple steps
Csv to json transform in simple stepsCsv to json transform in simple steps
Csv to json transform in simple steps
Rahul Kumar
 
Using scatter gather
Using scatter gatherUsing scatter gather
Using scatter gather
Rahul Kumar
 
Choice router
Choice routerChoice router
Choice router
Rahul Kumar
 
Using idempotent filter
Using idempotent filterUsing idempotent filter
Using idempotent filter
Rahul Kumar
 
Combine collections transformer
Combine collections transformerCombine collections transformer
Combine collections transformer
Rahul Kumar
 
Creating global functions
Creating global functionsCreating global functions
Creating global functions
Rahul Kumar
 
Creating custom object store
Creating custom object storeCreating custom object store
Creating custom object store
Rahul Kumar
 
Using expression component
Using expression componentUsing expression component
Using expression component
Rahul Kumar
 
Creating custom transformer
Creating custom transformerCreating custom transformer
Creating custom transformer
Rahul Kumar
 
Creating custom aggregation strategy
Creating custom aggregation strategyCreating custom aggregation strategy
Creating custom aggregation strategy
Rahul Kumar
 
Creating custom aggregator
Creating custom aggregatorCreating custom aggregator
Creating custom aggregator
Rahul Kumar
 
Byte array to hex string transformer
Byte array to hex string transformerByte array to hex string transformer
Byte array to hex string transformer
Rahul Kumar
 
Creating custom filter
Creating custom filterCreating custom filter
Creating custom filter
Rahul Kumar
 
Hex string to byte array transformer
Hex string to byte array transformerHex string to byte array transformer
Hex string to byte array transformer
Rahul Kumar
 
XML to DOM Transformer
XML to DOM TransformerXML to DOM Transformer
XML to DOM Transformer
Rahul Kumar
 
Dom to xml transformer
Dom to xml transformerDom to xml transformer
Dom to xml transformer
Rahul Kumar
 
Object to input stream transformer
Object to input stream transformerObject to input stream transformer
Object to input stream transformer
Rahul Kumar
 
Byte array to object transformer
Byte array to object transformerByte array to object transformer
Byte array to object transformer
Rahul Kumar
 
Byte array to string transformer
Byte array to string transformerByte array to string transformer
Byte array to string transformer
Rahul Kumar
 
Object to string transformer
Object to string transformerObject to string transformer
Object to string transformer
Rahul Kumar
 
Csv to json transform in simple steps
Csv to json transform in simple stepsCsv to json transform in simple steps
Csv to json transform in simple steps
Rahul Kumar
 
Using scatter gather
Using scatter gatherUsing scatter gather
Using scatter gather
Rahul Kumar
 
Using idempotent filter
Using idempotent filterUsing idempotent filter
Using idempotent filter
Rahul Kumar
 
Ad

Recently uploaded (20)

Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
DVDFab Crack FREE Download Latest Version 2025
DVDFab Crack FREE Download Latest Version 2025DVDFab Crack FREE Download Latest Version 2025
DVDFab Crack FREE Download Latest Version 2025
younisnoman75
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Cryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptxCryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptx
riyageorge2024
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Foundation Models for Time Series : A Survey
Foundation Models for Time Series : A SurveyFoundation Models for Time Series : A Survey
Foundation Models for Time Series : A Survey
jayanthkalyanam1
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Full Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest VersionFull Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest Version
jonesmichealj2
 
Microsoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptxMicrosoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptx
Mekonnen
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Apple Logic Pro X Crack FRESH Version 2025
Apple Logic Pro X Crack FRESH Version 2025Apple Logic Pro X Crack FRESH Version 2025
Apple Logic Pro X Crack FRESH Version 2025
fs4635986
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
Lionel Briand
 
Implementing promises with typescripts, step by step
Implementing promises with typescripts, step by stepImplementing promises with typescripts, step by step
Implementing promises with typescripts, step by step
Ran Wahle
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
DVDFab Crack FREE Download Latest Version 2025
DVDFab Crack FREE Download Latest Version 2025DVDFab Crack FREE Download Latest Version 2025
DVDFab Crack FREE Download Latest Version 2025
younisnoman75
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Cryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptxCryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptx
riyageorge2024
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Foundation Models for Time Series : A Survey
Foundation Models for Time Series : A SurveyFoundation Models for Time Series : A Survey
Foundation Models for Time Series : A Survey
jayanthkalyanam1
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Full Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest VersionFull Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest Version
jonesmichealj2
 
Microsoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptxMicrosoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptx
Mekonnen
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Apple Logic Pro X Crack FRESH Version 2025
Apple Logic Pro X Crack FRESH Version 2025Apple Logic Pro X Crack FRESH Version 2025
Apple Logic Pro X Crack FRESH Version 2025
fs4635986
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
Lionel Briand
 
Implementing promises with typescripts, step by step
Implementing promises with typescripts, step by stepImplementing promises with typescripts, step by step
Implementing promises with typescripts, step by step
Ran Wahle
 

Using parse template component

  • 2. Parse Template Component Use a parse template to load the content of a flow-external file into a Mule flow, then use the file as a template into which you can insert data returned as the result of evaluated Mule expressions. Groovy also allows the developer to configure interceptors and alter the values or references of particular properties in a script. Interceptors are configured to provide additional services to a message as it flows through a component
  • 3. Parse Template Component For example, perhaps you want a Mule flow to send an "order complete" HTTP response to a caller to indicate the new order’s number and the number of widgets ordered (both values that you previously set on the Mule message as variables). You can use a parse template to load a file from an external location – a file which, behaving as a template, expects values for "order number" and "number of widgets". Then, 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. In essence, a parse template pulls a template file into a Mule flow, fills in the blanks, then sets results on the message as the payload. In the example, after the parse template sets the payload on the message using the external file as a template, the Mule flow returns the HTTP response to confirm the order
  • 4. Configuratio : Location : Define the location of the file that Mule uses as a template into which to insert values extracted from the message properties or variables.
  • 5. Examples <html> <body> <table> <tr> <th>First Name</th> <th>Last Name</th> <th>Department</th> <th>Job Title</th> <th>Start Date</th> <th>Employee Type</th> </tr> <tr> <td>#[payload[0]['first_name']]</td> <td>#[payload[0]['last_name']]</td> <td>#[payload[0]['department']]</td> <td>#[payload[0]['job_title']]</td> <td>#[payload[0]['start_date']]</td> <td>#[payload[0]['employee_type']]</td>
  • 6. Examples <flow name="exampleTemplateFlow1" > <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP" doc:description="Send GET request with a parameter, for example, http://localhost:8081/getEmployee?id=12345"/> <jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="getEmployeeById" queryTimeout="-1" connector-ref="Database" doc:name="Database" doc:description="Returns list of maps containing records; only the first one is required."/> <parse-template location="src/test/resources/responseHtml.template" doc:name="Parse Template"/> <set-property doc:name="Content Type" propertyName="Content-Type" value="text/html"/> </flow>
  • 7. Examples To use the application in this example, you must send an HTTP request with a URL that includes an id query parameter, such as http://localhost:8081/getEmployee?id=12345. Dynamic HTML is returned according to the Mule expressions in the template