SlideShare une entreprise Scribd logo
1  sur  13
Mule ESB has the ability to store data into variables.
Fortunately Mule offers 2 types of variables 1) Flow variables that has scope limited
to a flow and subflow and 2) Session variables that has scope and can be accessed
from entire application.
Now, one interesting facts I come across several Mule users is how to define a List
or a Map with a variable in Mule in the same way as Java.
Let me tell you, this is absolutely possible with Mule.
We can define List or a Map in Mule with Mule variables.
We can define a List with a Mule variable in following ways :-
<set-variable variableName="test" value="#[{1000,100,14,1}]" doc:name="Variable"/>
Or
<set-variable variableName="test" value="#[[1000,100,14,1]]" doc:name="Variable"/>
Here you can see we define a variable named as test which is defined as a List
Now, we can get the values from the List as follow :-
<logger level="INFO" message="#[flowVars['test'][0]]" doc:name="Logger"/>
<logger level="INFO" message="#[flowVars['test'][1]]" doc:name="Logger"/>
<logger level="INFO" message="#[flowVars['test'][2]]" doc:name="Logger"/>
<logger level="INFO" message="#[flowVars['test'][3]]" doc:name="Logger"/>
As you can see we are retrieving the values from the List with the index
Now, we can define a Map in the same way as follow :-
<set-variable variableName="customMap" value="#[{'k2':'new', 'k3':'v3'}]" />
Or
<set-variable variableName="customMap" value="#[['k2':'new', 'k3':'v3‘]]" />
Here you can see we define a variable named as customMap which is defined as a
Map
Now, we can get the values from the Map as follow :-
<logger message="#[flowVars['customMap']['k2']] " level="INFO"
doc:name="Logger"/>
<logger message="#[flowVars['customMap']['k3']] " level="INFO"
doc:name="Logger"/>
As you can see we are retrieving the values from the Map with the key
Now, let us consider a simple flow to demonstrate the List and the Map as follow :-
The Mule config will be :-
You can see here we are using Expression component to reassign our List value of index
1 and index 2 … Then we are using logger to print the new value of List again in the
console
So, if we test the example we will get all the value of List and Map variables as follow as
well as with new reassigned value :-
So, here you can see how to use a List and Map with Mule variable… Hope I was
clear enough to give an Idea of it’s implementation ….
In my next slide I will bring some other techniques in Mule implementation .
Hope you have enjoyed this simpler version.
Keep sharing your knowledge and let our Mule community grow 
Mapping and listing with mule

Contenu connexe

Tendances

Converting with custom transformer
Converting with custom transformerConverting with custom transformer
Converting with custom transformerF K
 
Xslt with mule
Xslt with muleXslt with mule
Xslt with muleSon Nguyen
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in muleRajkattamuri
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mulemdfkhan625
 
Mule XSLT Transformer
Mule XSLT TransformerMule XSLT Transformer
Mule XSLT TransformerAnkush Sharma
 
Mule accessing multiple database in parallel
Mule accessing multiple database in parallelMule accessing multiple database in parallel
Mule accessing multiple database in parallelAnirban Sen Chowdhary
 
Integrate with database by groovy
Integrate with database by groovyIntegrate with database by groovy
Integrate with database by groovySon Nguyen
 

Tendances (12)

Idempotent filter with simple file
Idempotent filter with simple fileIdempotent filter with simple file
Idempotent filter with simple file
 
Converting with custom transformer
Converting with custom transformerConverting with custom transformer
Converting with custom transformer
 
Xslt with mule
Xslt with muleXslt with mule
Xslt with mule
 
Splitting with mule part2
Splitting with mule part2Splitting with mule part2
Splitting with mule part2
 
Map in Mule
Map in MuleMap in Mule
Map in Mule
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Mule XSLT Transformer
Mule XSLT TransformerMule XSLT Transformer
Mule XSLT Transformer
 
Mule accessing multiple database in parallel
Mule accessing multiple database in parallelMule accessing multiple database in parallel
Mule accessing multiple database in parallel
 
Integrate with database by groovy
Integrate with database by groovyIntegrate with database by groovy
Integrate with database by groovy
 
xslt in mule
xslt in mulexslt in mule
xslt in mule
 

En vedette (20)

Mule google connectors
Mule google connectorsMule google connectors
Mule google connectors
 
Mule technology
Mule technologyMule technology
Mule technology
 
Mule soap
Mule soapMule soap
Mule soap
 
How to use expression filter
How to use expression filter How to use expression filter
How to use expression filter
 
Documantation with mule
Documantation with mule Documantation with mule
Documantation with mule
 
Mmc rest api user groups
Mmc rest api user groups Mmc rest api user groups
Mmc rest api user groups
 
Mule security-jaas
Mule security-jaasMule security-jaas
Mule security-jaas
 
Mule quartz
Mule quartz Mule quartz
Mule quartz
 
Mule anypoint exchange
Mule anypoint exchangeMule anypoint exchange
Mule anypoint exchange
 
Mule oracle connectors
Mule oracle connectorsMule oracle connectors
Mule oracle connectors
 
Mule batch processing
Mule batch processingMule batch processing
Mule batch processing
 
CSP Review Report_Final (1)
CSP Review Report_Final (1)CSP Review Report_Final (1)
CSP Review Report_Final (1)
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gateway
 
Mule velocity
Mule velocityMule velocity
Mule velocity
 
Introduction to mule esb
Introduction to mule esbIntroduction to mule esb
Introduction to mule esb
 
Soap request in mule
Soap request in mule Soap request in mule
Soap request in mule
 
Damaging damzelz' no.1
Damaging damzelz' no.1Damaging damzelz' no.1
Damaging damzelz' no.1
 
Webservice vm in mule
Webservice vm in muleWebservice vm in mule
Webservice vm in mule
 
Groovy in Mule
Groovy in MuleGroovy in Mule
Groovy in Mule
 

Similaire à Mapping and listing with mule

Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with muleAnand kalla
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with muleKhasim Saheb
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with muleSunil Komarapu
 
Using map and list starter
Using map and list starterUsing map and list starter
Using map and list starterSon Nguyen
 
Multi database access
Multi database accessMulti database access
Multi database accessSon Nguyen
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mulejaveed_mhd
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in muleMohammed625
 
Xml to xml transformation
Xml to xml transformationXml to xml transformation
Xml to xml transformationSon Nguyen
 
Apache Scoop - Import with Append mode and Last Modified mode
Apache Scoop - Import with Append mode and Last Modified mode Apache Scoop - Import with Append mode and Last Modified mode
Apache Scoop - Import with Append mode and Last Modified mode Rupak Roy
 
Knockoutjs Part 2 Beginners
Knockoutjs Part 2 BeginnersKnockoutjs Part 2 Beginners
Knockoutjs Part 2 BeginnersBhaumik Patel
 
My sql with querys
My sql with querysMy sql with querys
My sql with querysNIRMAL FELIX
 
Data weave (MuleSoft)
Data weave (MuleSoft)Data weave (MuleSoft)
Data weave (MuleSoft)Nandu List5
 
Database integrate with mule
Database integrate with muleDatabase integrate with mule
Database integrate with muleSon Nguyen
 
Introduction of ssis
Introduction of ssisIntroduction of ssis
Introduction of ssisdeepakk073
 

Similaire à Mapping and listing with mule (20)

Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mule
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mule
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mule
 
Using map and list starter
Using map and list starterUsing map and list starter
Using map and list starter
 
Multi database access
Multi database accessMulti database access
Multi database access
 
Parameters as a part of body
Parameters as a part of bodyParameters as a part of body
Parameters as a part of body
 
Ijetr012023
Ijetr012023Ijetr012023
Ijetr012023
 
Xml transform
Xml transformXml transform
Xml transform
 
SQL
SQLSQL
SQL
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Operators
OperatorsOperators
Operators
 
Xml to xml transformation
Xml to xml transformationXml to xml transformation
Xml to xml transformation
 
Apache Scoop - Import with Append mode and Last Modified mode
Apache Scoop - Import with Append mode and Last Modified mode Apache Scoop - Import with Append mode and Last Modified mode
Apache Scoop - Import with Append mode and Last Modified mode
 
Knockoutjs Part 2 Beginners
Knockoutjs Part 2 BeginnersKnockoutjs Part 2 Beginners
Knockoutjs Part 2 Beginners
 
My sql with querys
My sql with querysMy sql with querys
My sql with querys
 
Data weave (MuleSoft)
Data weave (MuleSoft)Data weave (MuleSoft)
Data weave (MuleSoft)
 
Database integrate with mule
Database integrate with muleDatabase integrate with mule
Database integrate with mule
 
Mule mel 5_tips
Mule mel 5_tipsMule mel 5_tips
Mule mel 5_tips
 
Introduction of ssis
Introduction of ssisIntroduction of ssis
Introduction of ssis
 

Plus de Praneethchampion (14)

Mule execution
Mule executionMule execution
Mule execution
 
Mule soa
Mule soaMule soa
Mule soa
 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripe
 
Dataweave
Dataweave Dataweave
Dataweave
 
Mule for each scope header collection
Mule for each scope header collectionMule for each scope header collection
Mule for each scope header collection
 
Mmc
Mmc Mmc
Mmc
 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layer
 
Mule security
Mule securityMule security
Mule security
 
Scatter gather flow in mule
Scatter gather flow in muleScatter gather flow in mule
Scatter gather flow in mule
 
Mule rabbitmq
Mule rabbitmqMule rabbitmq
Mule rabbitmq
 
Mule drools
Mule drools Mule drools
Mule drools
 
Mule esb DataWeave
Mule esb DataWeaveMule esb DataWeave
Mule esb DataWeave
 
Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in mule
 
Creating dynamic json in mule
Creating dynamic json in muleCreating dynamic json in mule
Creating dynamic json in mule
 

Dernier

Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Dernier (20)

Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

Mapping and listing with mule

  • 1.
  • 2. Mule ESB has the ability to store data into variables. Fortunately Mule offers 2 types of variables 1) Flow variables that has scope limited to a flow and subflow and 2) Session variables that has scope and can be accessed from entire application. Now, one interesting facts I come across several Mule users is how to define a List or a Map with a variable in Mule in the same way as Java. Let me tell you, this is absolutely possible with Mule. We can define List or a Map in Mule with Mule variables.
  • 3.
  • 4. We can define a List with a Mule variable in following ways :- <set-variable variableName="test" value="#[{1000,100,14,1}]" doc:name="Variable"/> Or <set-variable variableName="test" value="#[[1000,100,14,1]]" doc:name="Variable"/> Here you can see we define a variable named as test which is defined as a List
  • 5. Now, we can get the values from the List as follow :- <logger level="INFO" message="#[flowVars['test'][0]]" doc:name="Logger"/> <logger level="INFO" message="#[flowVars['test'][1]]" doc:name="Logger"/> <logger level="INFO" message="#[flowVars['test'][2]]" doc:name="Logger"/> <logger level="INFO" message="#[flowVars['test'][3]]" doc:name="Logger"/> As you can see we are retrieving the values from the List with the index
  • 6. Now, we can define a Map in the same way as follow :- <set-variable variableName="customMap" value="#[{'k2':'new', 'k3':'v3'}]" /> Or <set-variable variableName="customMap" value="#[['k2':'new', 'k3':'v3‘]]" /> Here you can see we define a variable named as customMap which is defined as a Map
  • 7. Now, we can get the values from the Map as follow :- <logger message="#[flowVars['customMap']['k2']] " level="INFO" doc:name="Logger"/> <logger message="#[flowVars['customMap']['k3']] " level="INFO" doc:name="Logger"/> As you can see we are retrieving the values from the Map with the key
  • 8. Now, let us consider a simple flow to demonstrate the List and the Map as follow :-
  • 9. The Mule config will be :- You can see here we are using Expression component to reassign our List value of index 1 and index 2 … Then we are using logger to print the new value of List again in the console
  • 10. So, if we test the example we will get all the value of List and Map variables as follow as well as with new reassigned value :-
  • 11. So, here you can see how to use a List and Map with Mule variable… Hope I was clear enough to give an Idea of it’s implementation ….
  • 12. In my next slide I will bring some other techniques in Mule implementation . Hope you have enjoyed this simpler version. Keep sharing your knowledge and let our Mule community grow 