Hi I am not sure if I understand your question right, but the way I understand it is. You have some action that either can forward to itself (looping) 3 times ( 4 time it should be a workflow violation) or in case everything is ok forward to another action ? Well you have a couple of options. You could have a action mapping like this <action path="/somePossibleLoopingAction" type="dk.somePackage.someAction" name="someForm" scope="session"> <set-property property="primaryWorkflow" value="MyWorkflow" /> <set-property property="prevState" value="loginfailure" /> <set-property property="prevState" value="someOtherState" /> <set-property property="newState" value="loginfailure" /> <set-property property="nextState" value="loginfailure" /> <set-property property="nextState" value="loginsuccess" /> <forward name="success" path="/nextAction" /> <forward name="failureLogin" path="/somePossibleLoopingAction" /> <forward name="violateAction" path="/someActionThatViolates" /> </action>
In your somePossibleLoopingAction you could have a session variable that holds the count of unsuccessful logins, after the third it could foward to /someActionThatViolates, this action should of course have some states that would be violated and then the workflow engine would trigger a workflow violation where your session forms would be cleaned and you could eventually make sure that the user is banned or whatever you want. This should happen in your workflow violation action class. Just make sure you have a global forward like this ! <forward name="workflowViolation_MyWorkflow" path="/handleWorkflowLoginViolation.do" /> And then of course the action mapping represented by the /handleWorkflowLoginViolation.do. <action path="/handleWorkflowLoginViolation" type="dk.somePackage.SomeAction"> <set-property property="primaryWorkflow" value="MyWorkflow" /> <set-property property="endWorkflow" value="true" /> - makes sure that this workflow is ended <forward name="noNextStateViolation" path="/somePathOfYourChoice /> </action> In case you are in the looping phase, take a look at the workflow mapping. As you can see we have a prevState and a newState and even a nextState that are the same. This means this action accepts that the previous action is itself, and that the next action can be itself, that's the way I implemented it. Hope this helps, if you have more questions feel free to ask! Cheers Tommy -----Oprindelig meddelelse----- Fra: Joanne L Corless [mailto:[EMAIL PROTECTED] Sendt: 2. marts 2004 18:16 Til: [EMAIL PROTECTED] Emne: Struts Workflow - Questions ? Hi, I'm trying to resolve a problem I have by making use of Struts Workflow - Using this as I need something that will prevent "jump-out" within the process The login process of my app has a number of conditions which dictate which page I send the user to next. I understand the basic's of the Struts Workflow but am a little confused when we get to the looping/forwarding aspects Basically the section of the flow is as follows: SecurityFilterAuthentication -> Is User Authenticated ? If Y -> StartWorkflow -> Retrieve User Settings -> Is 3fromN login required ? If Y -> Do 3FromN Else ->Record Successful Login -> .......Continue Workflow The 3FromN section has to allow the user 3 attempts and then do a Lock Out Action or if successful continue to the Record Successful Login Action How do I make those decisions within the workflow ? Do I have to have an action for every decision node or can I set what the next action should be in the active one using return (new ActionForward(<nextAction>)); Regards Joanne Corless --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]