14
FlowVars vs SessionVars

Flowvar and Sessionvar in Mule

Embed Size (px)

Citation preview

Page 1: Flowvar and Sessionvar in Mule

FlowVars vs SessionVars

Page 2: Flowvar and Sessionvar in Mule

FlowVars

• flowVars retain their values as control passes from one message processor to another within a single flow. Thus, you can set them in one message processor, then access them in another message processor using a MEL expression

Page 3: Flowvar and Sessionvar in Mule

SessionVars

• sessionVars that retain their values as control passes from one flow to another within an application. Thus, you can set them in one flow, then access them in another using a MEL expression.

Page 4: Flowvar and Sessionvar in Mule

Using FlowVars and SessionVars in Mule

Application

Page 5: Flowvar and Sessionvar in Mule
Page 6: Flowvar and Sessionvar in Mule

• Based from the previous slide, I assume you already have a based project to start working on this.

• Simply used http for the inbound so we could test the functionality and difference of flowVars and sessionVars

Page 7: Flowvar and Sessionvar in Mule
Page 8: Flowvar and Sessionvar in Mule

• Based from the previous slide, I simply inititiate or declare the values for the flow vars and session vars.

• testFlowVar "this is a flowvar"

• testSessionVar "this is a sessionVar"

Page 9: Flowvar and Sessionvar in Mule

Log result

Page 10: Flowvar and Sessionvar in Mule
Page 11: Flowvar and Sessionvar in Mule
Page 12: Flowvar and Sessionvar in Mule

• Based from the result, you can access session var within the mule application while the flow var can only be access within the flow only.

Page 13: Flowvar and Sessionvar in Mule

Reference:

• https://docs.mulesoft.com/mule-user-guide/v/3.6/mule-expression-language-reference#context-objects-variables-and-fields

Page 14: Flowvar and Sessionvar in Mule

END