SlideShare a Scribd company logo
1 of 13
Mapping and Listing with Mule
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

More Related Content

What's hot

What's hot (13)

Mule accessing multiple database in parallel
Mule accessing multiple database in parallelMule accessing multiple database in parallel
Mule accessing multiple database in parallel
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Idempotent filter with simple file
Idempotent filter with simple fileIdempotent filter with simple file
Idempotent filter with simple file
 
Json to json transformation in mule
Json to json transformation in muleJson to json transformation in mule
Json to json transformation in mule
 
Map in Mule
Map in MuleMap in Mule
Map in Mule
 
Mule XSLT Transformer
Mule XSLT TransformerMule XSLT Transformer
Mule XSLT Transformer
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Converting with custom transformer
Converting with custom transformerConverting with custom transformer
Converting with custom transformer
 
xslt in mule
xslt in mulexslt in mule
xslt in mule
 
Splitting with mule part2
Splitting with mule part2Splitting with mule part2
Splitting with mule part2
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with 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 esb
Mule esbMule esb
Mule esb
 

Viewers also liked

Database component in mule
Database component in muleDatabase component in mule
Database component in mulejaveed_mhd
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mulejaveed_mhd
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in MuleMohammed246
 
Mule database-connectors
Mule database-connectorsMule database-connectors
Mule database-connectorsAnand kalla
 
Mule for each scope headerc ollection
Mule for each scope headerc ollectionMule for each scope headerc ollection
Mule for each scope headerc ollectionKhasim Saheb
 
Mule management console installation
Mule management console installation Mule management console installation
Mule management console installation javeed_mhd
 
Install sonarqube plugin in anypoint
Install sonarqube plugin in anypoint Install sonarqube plugin in anypoint
Install sonarqube plugin in anypoint F K
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mulejaveed_mhd
 
Mule security saml
Mule security samlMule security saml
Mule security samlKhasim Saheb
 
How to install sonarqube plugin in anypoint
How to install sonarqube plugin in anypoint How to install sonarqube plugin in anypoint
How to install sonarqube plugin in anypoint javeed_mhd
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mulejaveed_mhd
 
Mule esb made system integration easy
Mule esb made system integration easy Mule esb made system integration easy
Mule esb made system integration easy javeed_mhd
 
Commit a project in svn using svn plugin in anypoint studio
Commit a project in svn using svn plugin in anypoint studioCommit a project in svn using svn plugin in anypoint studio
Commit a project in svn using svn plugin in anypoint studioF K
 
For each component in mule
For each component in muleFor each component in mule
For each component in mulejaveed_mhd
 
Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gatewayKhasim Saheb
 

Viewers also liked (20)

Database component in mule
Database component in muleDatabase component in mule
Database component in mule
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
 
Mule soa
Mule soaMule soa
Mule soa
 
Mule database-connectors
Mule database-connectorsMule database-connectors
Mule database-connectors
 
Mule jdbc
Mule   jdbcMule   jdbc
Mule jdbc
 
Mule for each scope headerc ollection
Mule for each scope headerc ollectionMule for each scope headerc ollection
Mule for each scope headerc ollection
 
Mule management console installation
Mule management console installation Mule management console installation
Mule management console installation
 
Install sonarqube plugin in anypoint
Install sonarqube plugin in anypoint Install sonarqube plugin in anypoint
Install sonarqube plugin in anypoint
 
Mule esb
Mule esbMule esb
Mule esb
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
Mule security saml
Mule security samlMule security saml
Mule security saml
 
How to install sonarqube plugin in anypoint
How to install sonarqube plugin in anypoint How to install sonarqube plugin in anypoint
How to install sonarqube plugin in anypoint
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mule
 
Dataweave 160103180124
Dataweave 160103180124Dataweave 160103180124
Dataweave 160103180124
 
Mule esb made system integration easy
Mule esb made system integration easy Mule esb made system integration easy
Mule esb made system integration easy
 
Commit a project in svn using svn plugin in anypoint studio
Commit a project in svn using svn plugin in anypoint studioCommit a project in svn using svn plugin in anypoint studio
Commit a project in svn using svn plugin in anypoint studio
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
 
Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gateway
 
Mule esb
Mule esbMule esb
Mule esb
 

Similar to Mapping and listing with mule

Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mulemdfkhan625
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with muleirfan1008
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mulePhaniu
 
Mapping and listing with mule
Mapping and listing with mule Mapping and listing with mule
Mapping and listing with mule javeed_mhd
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with muleprinceirfancivil
 
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 in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mulemdfkhan625
 
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
 
Mdx Basics
Mdx BasicsMdx Basics
Mdx BasicsALIPPHAR
 
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
 

Similar to 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
 
Mapping and listing with mule
Mapping and listing with mule Mapping 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
 
Ijetr012023
Ijetr012023Ijetr012023
Ijetr012023
 
Xml transform
Xml transformXml transform
Xml transform
 
Multi database access
Multi database accessMulti database access
Multi database access
 
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
 
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
Xml to xml transformationXml to xml transformation
Xml to xml transformation
 
Operators
OperatorsOperators
Operators
 
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
 
Mdx Basics
Mdx BasicsMdx Basics
Mdx Basics
 
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
 
Mule mel 5_tips
Mule mel 5_tipsMule mel 5_tips
Mule mel 5_tips
 

More from Khasim Saheb

Mule anypoint exchange
Mule anypoint exchangeMule anypoint exchange
Mule anypoint exchangeKhasim Saheb
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaasKhasim Saheb
 
Mule integration with linkedin
Mule integration with linkedinMule integration with linkedin
Mule integration with linkedinKhasim Saheb
 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layerKhasim Saheb
 
Mmc rest api user groups
Mmc rest api user groupsMmc rest api user groups
Mmc rest api user groupsKhasim Saheb
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentKhasim Saheb
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filterKhasim Saheb
 
Creating dynamic json
Creating dynamic json Creating dynamic json
Creating dynamic json Khasim Saheb
 
Converting with custom transforme
Converting with custom transformeConverting with custom transforme
Converting with custom transformeKhasim Saheb
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed storeKhasim Saheb
 
Cache for community edition
Cache for community edition Cache for community edition
Cache for community edition Khasim Saheb
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule Khasim Saheb
 
A simple webservice with vm
A simple webservice with vm A simple webservice with vm
A simple webservice with vm Khasim Saheb
 

More from Khasim Saheb (20)

Mule architecture
Mule architectureMule architecture
Mule architecture
 
Mule anypoint exchange
Mule anypoint exchangeMule anypoint exchange
Mule anypoint exchange
 
Mule soap
Mule soapMule soap
Mule soap
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaas
 
Mule integration with linkedin
Mule integration with linkedinMule integration with linkedin
Mule integration with linkedin
 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripe
 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layer
 
Mmc
MmcMmc
Mmc
 
Mmc rest api user groups
Mmc rest api user groupsMmc rest api user groups
Mmc rest api user groups
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
Data weave
Data weave Data weave
Data weave
 
Creating dynamic json
Creating dynamic json Creating dynamic json
Creating dynamic json
 
Converting with custom transforme
Converting with custom transformeConverting with custom transforme
Converting with custom transforme
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
 
Cache for community edition
Cache for community edition Cache for community edition
Cache for community edition
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
 
A simple webservice with vm
A simple webservice with vm A simple webservice with vm
A simple webservice with vm
 
mule salesforce
mule salesforcemule salesforce
mule salesforce
 
mulesoft filters
mulesoft filtersmulesoft filters
mulesoft filters
 

Recently uploaded

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Recently uploaded (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Mapping and listing with mule

  • 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 