Friday, July 24, 2009

Parallel flows in Spring Web Flow and Struts2

Investigated issue with struts2webflow plugin for Struts2.
When SessionFlowExecKeyInterceptor is used for managing "flowExecutionKey" it should have different sessioinKey for each flow in order to make parallel flows possible.

Here is how this can be done.

1. Define SessionFlowExecKeyInterceptor with unique sessionKey for each flow.

<interceptor name="customSessionFlowExecKey" class="com.googlecode.struts2webflow.SessionFlowExecKeyInterceptor">
    <param name="sessionKey">SessionFlowExecKeyInterceptor.CUSTOM_FLOW_SESSION_KEY</param>
</interceptor>


2. Set this interceptor to the flow action.

<action name="customAction" class="com.googlecode.struts2webflow.FlowAction">
    <interceptor-ref name="customSessionFlowExecKey"/>
    ...
</action>


This issue is also described in struts2webflow here.

0 comments:

Post a Comment