SlideShare a Scribd company logo
1 of 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

More Related Content

What's hot

Json to json transformation in mule
Json to json transformation in muleJson to json transformation in mule
Json to json transformation in muleAntonio Pellegrino
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in muleirfan1008
 
Converting with custom transformer
Converting with custom transformerConverting with custom transformer
Converting with custom transformerF K
 
Mule esb How to use Jackson in Object to Json converter
Mule esb How to use Jackson in Object to Json converterMule esb How to use Jackson in Object to Json converter
Mule esb How to use Jackson in Object to Json converterRaffaela Vitiello
 
Stored procedure in mule
Stored procedure in muleStored procedure in mule
Stored procedure in muleSon Nguyen
 
Database integrate with mule
Database integrate with muleDatabase integrate with mule
Database integrate with muleSon Nguyen
 
Mule esb How to use Jackson in Json to Object converter
Mule esb How to use Jackson in Json to Object converterMule esb How to use Jackson in Json to Object converter
Mule esb How to use Jackson in Json to Object converterGennaro Spagnoli
 
Mule esb How to convert from Object to Json in 5 minutes
Mule esb How to convert from Object to Json in 5 minutesMule esb How to convert from Object to Json in 5 minutes
Mule esb How to convert from Object to Json in 5 minutesGennaro Spagnoli
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in muleRajkattamuri
 

What's hot (13)

Splitting with mule part2
Splitting with mule part2Splitting with mule part2
Splitting with mule part2
 
Json to json transformation in mule
Json to json transformation in muleJson to json transformation in mule
Json to json transformation in mule
 
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
 
Filtering jms messages with mule
Filtering jms messages with muleFiltering jms messages with mule
Filtering jms messages with mule
 
Mule esb How to use Jackson in Object to Json converter
Mule esb How to use Jackson in Object to Json converterMule esb How to use Jackson in Object to Json converter
Mule esb How to use Jackson in Object to Json converter
 
Stored procedure in mule
Stored procedure in muleStored procedure in mule
Stored procedure in mule
 
Database integrate with mule
Database integrate with muleDatabase integrate with mule
Database integrate with mule
 
Mule esb How to use Jackson in Json to Object converter
Mule esb How to use Jackson in Json to Object converterMule esb How to use Jackson in Json to Object converter
Mule esb How to use Jackson in Json to Object converter
 
Accessing jms in mule using groovy
Accessing jms in mule using groovyAccessing jms in mule using groovy
Accessing jms in mule using groovy
 
Mule esb How to convert from Object to Json in 5 minutes
Mule esb How to convert from Object to Json in 5 minutesMule esb How to convert from Object to Json in 5 minutes
Mule esb How to convert from Object to Json in 5 minutes
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Mule xml parsing
Mule xml parsingMule xml parsing
Mule xml parsing
 

Viewers also liked

Viewers also liked (13)

Women participation in peace process
Women participation in peace processWomen participation in peace process
Women participation in peace process
 
Mule esb Data Weave
Mule esb Data WeaveMule esb Data Weave
Mule esb Data Weave
 
Hi600 u13_inst_slides
Hi600 u13_inst_slidesHi600 u13_inst_slides
Hi600 u13_inst_slides
 
The mobile revolution is here: engaging our users where they are
The mobile revolution is here: engaging our users where they areThe mobile revolution is here: engaging our users where they are
The mobile revolution is here: engaging our users where they are
 
Instintos, Sexo y Sexualidad.
Instintos, Sexo y Sexualidad.Instintos, Sexo y Sexualidad.
Instintos, Sexo y Sexualidad.
 
cultivation practices of of peach
cultivation practices of  of peachcultivation practices of  of peach
cultivation practices of of peach
 
Procesos mentales
Procesos mentalesProcesos mentales
Procesos mentales
 
02 baumgartner
02 baumgartner02 baumgartner
02 baumgartner
 
10 cantin
10 cantin10 cantin
10 cantin
 
Suppurative lung diseases
Suppurative lung diseasesSuppurative lung diseases
Suppurative lung diseases
 
Ley resorte
Ley resorteLey resorte
Ley resorte
 
Macroestructura
MacroestructuraMacroestructura
Macroestructura
 
Mule with velocity
Mule with velocityMule with velocity
Mule with velocity
 

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 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
 
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
 
Mule xml transformation
Mule xml transformationMule xml transformation
Mule xml transformationD.Rajesh Kumar
 
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
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mulemdfkhan625
 
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
 

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
 
Mule accessing multiple database in parallel
Mule accessing multiple database in parallelMule accessing multiple database in parallel
Mule accessing multiple database in parallel
 
Mule xml transformation
Mule xml transformationMule xml transformation
Mule xml transformation
 
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
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
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)
 
Mule mel 5_tips
Mule mel 5_tipsMule mel 5_tips
Mule mel 5_tips
 

More from javeed_mhd

For each component in mule
For each component in muleFor each component in mule
For each component in mulejaveed_mhd
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mulejaveed_mhd
 
File component in mule
File component in muleFile component in mule
File component in mulejaveed_mhd
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mulejaveed_mhd
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mulejaveed_mhd
 
Vm component in mule
Vm component in muleVm component in mule
Vm component in mulejaveed_mhd
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mulejaveed_mhd
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mulejaveed_mhd
 
Mule management console installation
Mule management console installation Mule management console installation
Mule management console installation javeed_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
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mulejaveed_mhd
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo javeed_mhd
 
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
 
How to commit a project in svn using svn plugin in anypointstudio
How to commit a project in svn using svn plugin in anypointstudioHow to commit a project in svn using svn plugin in anypointstudio
How to commit a project in svn using svn plugin in anypointstudiojaveed_mhd
 
Mule any point exchange
Mule any point exchangeMule any point exchange
Mule any point exchangejaveed_mhd
 
Mule esb api layer
Mule esb api layer Mule esb api layer
Mule esb api layer javeed_mhd
 
Mule Maven Plugin
Mule Maven PluginMule Maven Plugin
Mule Maven Pluginjaveed_mhd
 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripejaveed_mhd
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedurejaveed_mhd
 
Deploying and running in mule standalone
Deploying and running in mule standaloneDeploying and running in mule standalone
Deploying and running in mule standalonejaveed_mhd
 

More from javeed_mhd (20)

For each component in mule
For each component in muleFor each component in mule
For each component in mule
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
 
File component in mule
File component in muleFile component in mule
File component in mule
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mule
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mule
 
Vm component in mule
Vm component in muleVm component in mule
Vm component in mule
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mule
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mule
 
Mule management console installation
Mule management console installation Mule management console installation
Mule management console installation
 
Mule esb made system integration easy
Mule esb made system integration easy Mule esb made system integration easy
Mule esb made system integration easy
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
 
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
 
How to commit a project in svn using svn plugin in anypointstudio
How to commit a project in svn using svn plugin in anypointstudioHow to commit a project in svn using svn plugin in anypointstudio
How to commit a project in svn using svn plugin in anypointstudio
 
Mule any point exchange
Mule any point exchangeMule any point exchange
Mule any point exchange
 
Mule esb api layer
Mule esb api layer Mule esb api layer
Mule esb api layer
 
Mule Maven Plugin
Mule Maven PluginMule Maven Plugin
Mule Maven Plugin
 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripe
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedure
 
Deploying and running in mule standalone
Deploying and running in mule standaloneDeploying and running in mule standalone
Deploying and running in mule standalone
 

Recently uploaded

Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
#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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
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
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
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
 

Recently uploaded (20)

Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
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
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
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
 

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 