Re: SessionContext with IAction (128 Views)
Reply
Occasional Advisor
SwatiShah
Posts: 8
Registered: ‎03-28-2012
Message 1 of 3 (173 Views)

SessionContext with IAction

[ Edited ]

IAction execute method uses SessionContext and returns SessionID. But can we reuse this session and force code to reuse if session specified exists? Or does it always have to be a new session?

 

For Eg: Some IAction code is executing custom code and puts a specific information in SessionContext. If from OO flow I can't reuse same session developer will have to maintain (read and reuse) that information? Sample exist in HTTPClient actions which store HTTPCookies for the sesion.

Advisor
Daniel_Linsley
Posts: 15
Registered: ‎12-05-2011
Message 2 of 3 (128 Views)

Re: SessionContext with IAction

If I recall correctly, the SessionContext has a lifetime of a flow execution on that particular RAS.  It cannot be transferred to another RAS, read by a future execution of a flow, or read by a different flow even if you know the sessionid.

 

You can treat the SessionContext as a java.util.Map (as what the HTTPClient does with cookies).  It is useful for retaining some data between IAction.execute() calls for related IActions.

Occasional Advisor
SwatiShah
Posts: 8
Registered: ‎03-28-2012
Message 3 of 3 (111 Views)

Re: SessionContext with IAction

So for example HTTP Post (Utility operation) is implemented as IAction and exposed to us. The code interface (inputs) allows us to set cookies to true or false. If set to true it stores the session in HTTPCookies variable but how can I use that again if it lasts only for that flow execution.

 

Is there any setting on jetty configuration which can instead manage sessions cause HTTP 1.1 keep session alive but these operations close them. I did modify the Iaction to keep it alive but still can't keep the same session going.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.