2. Agenda
Types of variables
Scope of variables
How to create variables
How to access variables
Demo
3. Variables
Types of variables in Mule
Flow variables
Session Variables
Record Variables
Flow-
1
Flow-
2
F1 S1
S1
Availability Flow
Variables are limited to
flow scope.
Session Variables are
available to access on
all flows of application
4. Scope of variables
The scope of Flow variables are within the Flow,
When the message leaves the flow,
the flow variable, set by the Variable Transformer ,
does not carry over to the next flow or application.
Variables set with a variable transformer persist only
for the current flow and cannot cross the transport
barrier.
session variables specified using the Session
Variable Transformer persist as long as the message
continues to be processed within your Mule
application, regardless of flow.
Session variables set with a session variable
transformer persist for the entire message lifecycle,
regardless of transport barriers.
6. How to access the variables
Using MEL variables can be accessed in the flow :
#[sessionVars.s1]
#[flowVars.emoNo]
In Java code :
muleMessage.getInvocationProperty("propertyName")