Saturday, September 22, 2012

decision-state sample for spring web flow 2.3.1.RELEASE

Flow definition:

    <decision -state="-state" id="customerselectionRequired">
        <if
test="xBean.conditionCheck(flowRequestContext)"                                 then="nextStep1"
                else="nextStep2">
   
     </if>    
    </decision> 

    <view-state id="nextStep1"> 

    <view-state id="nextStep2"> 

      
xBean is a JSF bean and we send "flowRequestContext" to the bean to have access to the flow details, inside "conditionCheck" method.

here is the body of  "conditionCheck":


    public boolean customerSelectionRequired(RequestContext code){
        code.getActiveFlow().getId(); // The name of the flow!

        /*
         * implementation
         */
    }

No comments:

Post a Comment