You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pedro Rodriguez <pr...@accovia.com> on 2003/11/17 16:44:56 UTC

[Struts Workflow] - Workflow Router Struts Action

I implemented a generic Struts's Action which allows for Workflow
routing in struts-config.
 
This Action receives an expression via its parameter. We use EL (Jakarta
taglib implementation). Variables are Workflow's names and their values
the corresponding Workflow's state. The expression must evaluate to a
Boolean. 
 
The only thing to do to implement a "workflow routing" is to add a
mapping to the struts-config where the expression (parameter) is
provided. 
 
All WorkflowRouter uses the same Action: WorkflowRouterAction.
 
<action
            path="/XXXXWorkflowRouter"
            type="MY_PACKAGE.WorkflowRouterAction"
            parameter="${myWorkflowLabel=='some_state'}" >
 
            <forward name="true" path="/SomeAction.do" />
            <forward name="false" path="/AnotherAction.so " />
</action>          
 
Thanks,
 
Pedro Rodriguez