简体   繁体   中英

How to increment session variable in mule ESB?

I have a requirement like first two messages need to be routed into one direction next three into another direction after some other root. I came to know that session variable scope and lifetime will be throughout the session. so i tried like

[sessionVars.count+1]

but getting concatenated value instead addition. initial count value is 0 and i'm running on mule 3.8.2.

First initialize your session variable

<set-session-variable variableName="count" value="#[0]"/>

To increment it

<set-session-variable variableName="count" value="#[sessionVars.count + 1]"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM