Hi Matthias OK, I have modified my workflow as I have seen the obvious errors in what I was trying to do. Now I have the problem that my second action (see code below) does not allow me to enter that step. The message that I am getting is "Previous state does not match any allowed previous state!". From what I can see, the "previousState" of the second step does match the "newState" of the first step. One thing that I have noticed is that when I enter the first state it says "Current State: null". Any ideas?
thanks Jordan <action path="/registration/1" type="scoop.web.struts.registration.RegistrationAction" className="com.livinglogic.struts.workflow.ApplicationMapping" name="registrationForm" scope="request" input="/tiles/registerCompany" validate="true"> <set-property property="primaryWorkflow" value="registration-workflow"/> <set-property property="newState" value="1"/> <set-property property="endWorkflow" value="false"/> <forward name="success" path="/tiles/registerCompany"/> </action> <action path="/registration/2" type="scoop.web.struts.registration.RegistrationAction" className="com.livinglogic.struts.workflow.ApplicationMapping" name="registrationForm" scope="session" input="/tiles/registerCompany_step1" validate="true"> <set-property property="primaryWorkflow" value="registration-workflow"/> <set-property property="newState" value="2"/> <set-property property="prevState" value="1"/> <set-property property="endWorkflow" value="false"/> <forward name="success" path="/tiles/registerCompany"/> </action> -----Original Message----- From: Matthias Bauer [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 27 November 2002 3:08 PM To: [EMAIL PROTECTED] Cc: 'Struts Users Mailing List' Subject: Re: AW: Workflow Extention Jordan, I think I understand pretty well, what you are trying to do. However according to your configuration you should not be able to execute "/registration/2" before having executed "/registration/1". Here are some examples: /registration -> /registration/1 -> /registration/1->/registration/2 - this should work /registration -> /registration/1 -> /registration/3 - this should fail with the last action /registration -> /registration/1 -> /registration/2->/registration/1 - this should fail with the last action /registration -> /registration/1 -> /someAction->/registration/2 - this should work, if "/someAction" is not part of the workflow Maybe you can try these examples out and see if it works as expected. Remark to the last example: The last example works, if "/someAction" is not part of the registration-workflow, because it does not change the state of this workflow. --- Matthias Jordan Thomas wrote: >Yes, I see what you are saying and if I define the next state, then if I >try to jump out of the workflow I get a an exception saying that it is >not allowed by the workflow. > >What makes me think that it is disregarding the wrokflow is that I can >enter the workflow at an point (i.e /registration/2) without having >executed any of the other steps. Essentially, all I want to do is not >control where the user goes but where the user came from. This way, it >cascades backwards ensuring that the user enters in all of the data. > >Is this clearer? Hopefully you have an idea on how to solve this one. > >Cheers and thanks for the help > >Jordan > >-----Ursprüngliche Nachricht----- >Von: Matthias Bauer [mailto:[EMAIL PROTECTED]] >Gesendet: Wednesday, 27 November 2002 1:22 PM >An: [EMAIL PROTECTED] >Cc: 'Struts Users Mailing List' >Betreff: Re: Workflow Extention > > >Jordan, > >according to the configuration the user should not be able to execute >"/registration/1" before having executed "/registration". Also >"/registration/2" can not be executed before "/registration/1", and so >on. > >What the configuration does NOT prohibit, is to execute "/registration" >or any other action after "/registration/1" or "/registration/2", >because you are not defining nextState values. > >Do you see something else? What lets you think that "it seems to be >disregarding the workflow"? > >One remark: You can as well leave away the property endWorkflow if you >want it to be false, because this is the default. > >--- Matthias > > > >Jordan Thomas wrote: > > > >>Matthias, >> >>Ok, I tried that and it now seems to be disregarding the workflow. Can >>you seen anything wrong with my struts-config.xml tags? (Sorry for the >>big code chunk >:O) Essentially what (am trying to do is allow a user >>to go to the next step or stay on the same step. I am using struts 1.1b >> >>Thanks >> >>Jordan >> >>----------action class------------ >> >>... >>public final class NewRegistrationAction extends GenericAction { .... >>public ActionForward performAction( ActionMapping mapping, ActionForm >>form, >> HttpServletRequest request, HttpServletResponse response ) >> throws IOException, ServletException { >>... >> >>----------struts-config.xml------------ >> >><action path="/registration" >> type="scoop.web.struts.registration.NewRegistrationAction" >> >>className="com.livinglogic.struts.workflow.ApplicationMapping" >> scope="request" >> input="/tiles/registrationDetails" >> validate="true"> >> <set-property property="primaryWorkflow" >>value="registration-workflow"/> >> <set-property property="newState" value="0"/> >> <set-property property="endWorkflow" value="false"/> >> <forward name="success" path="/tiles/registrationDetails"/> >> </action> >> <action path="/registration/1" >> type="scoop.web.struts.registration.NewRegistrationAction" >> >>className="com.livinglogic.struts.workflow.ApplicationMapping" >> name="registrationForm" >> scope="session" >> input="/tiles/registerCompany_step1" >> validate="true"> >> <set-property property="primaryWorkflow" >>value="registration-workflow"/> >> <set-property property="newState" value="1"/> >> <set-property property="prevState" value="0"/> >> <set-property property="prevState" value="1"/> >> <set-property property="endWorkflow" value="false"/> >> <forward name="success" path="/tiles/registerCompany_step1"/> >> </action> >> <action path="/registration/2" >> type="scoop.web.struts.registration.NewRegistrationAction" >> >>className="com.livinglogic.struts.workflow.ApplicationMapping" >> name="registrationForm" >> scope="session" >> input="/tiles/registerCompany_step2" >> validate="true"> >> <set-property property="primaryWorkflow" >>value="registration-workflow"/> >> <set-property property="newState" value="2"/> >> <set-property property="prevState" value="1"/> >> <set-property property="prevState" value="2"/> >> <set-property property="endWorkflow" value="false"/> >> <forward name="success" path="/tiles/registerCompany_step2"/> >> </action> >> <action path="/registration/3" >> type="scoop.web.struts.registration.NewRegistrationAction" >> >>className="com.livinglogic.struts.workflow.ApplicationMapping" >> name="registrationForm" >> scope="session" >> input="/tiles/registerCompany_step3" >> validate="true"> >> <set-property property="primaryWorkflow" >>value="registration-workflow"/> >> <set-property property="newState" value="3"/> >> <set-property property="prevState" value="2"/> >> <set-property property="prevState" value="3"/> >> <set-property property="endWorkflow" value="false"/> >> <forward name="success" path="/tiles/registerCompany_step3"/> >> </action> >> <action path="/registration/4" >> type="scoop.web.struts.registration.NewRegistrationAction" >> >>className="com.livinglogic.struts.workflow.ApplicationMapping" >> name="registrationForm" >> scope="session" >> input="/tiles/registerCompany_step4" >> validate="true"> >> <set-property property="primaryWorkflow" >>value="registration-workflow"/> >> <set-property property="newState" value="4"/> >> <set-property property="prevState" value="3"/> >> <set-property property="prevState" value="4"/> >> <set-property property="endWorkflow" value="false"/> >> <forward name="success" path="/tiles/registerCompany_step4"/> >> </action> >> <action path="/registration/5" >> type="scoop.web.struts.registration.NewRegistrationAction" >> >>className="com.livinglogic.struts.workflow.ApplicationMapping" >> name="registrationForm" >> scope="session" >> input="/tiles/registerCompany_step5" >> validate="true"> >> <set-property property="primaryWorkflow" >>value="registration-workflow"/> >> <set-property property="newState" value="5"/> >> <set-property property="prevState" value="4"/> >> <set-property property="prevState" value="5"/> >> <set-property property="endWorkflow" value="true"/> >> <forward name="success" path="/tiles/registerCompany_step5"/> >> </action> >> >> >> >>-----Original Message----- >>From: Matthias Bauer [mailto:[EMAIL PROTECTED]] >>Sent: Tuesday, 26 November 2002 8:36 AM >>To: Struts Users Mailing List >>Subject: Re: Workflow Extention >> >> >>Hi Jordan, >> >>sorry for the late response... >> >>You can not specify a wildcard like * for nextPath - the framework does >>not support that up to now. I would be happy to integrate it, if you >> >> >can > > >>explain a valid use case for it. >> >>Right now I do not see a necessity for a wildcard, because you can >>always leave away the "nextPath" and the "nextState" parameters, which >>has basically the same result: The action that follows next can be any >>action. >> >>To refer to you concrete problem: Preventing people from entering your >>workflow in the middle can be achieved by using the prevState >>parameters: >> >>If you have actions A, B, C and you want the user to execute B only if >>A >> >>has been executed before and C only if B has already been executed you >>can do the following: >> >>- equip action A with the state 1, action B with state 2 >>- set prevState=1 for action B and prevState=2 for action C >> >>This way action B can only be executed, if the workflow is in state 1 >>(i. e. action A has been executed) and action C can only be executed, >> >> >if > > >>the workflow is in state 2 (i. e. action B has been executed). >> >>Pls. let me know, if this helps. >> >>--- Matthias >> >> >>Jordan Thomas wrote: >> >> >> >> >> >>>Hi All, >>> >>>I am using the workflow extention to create my workflows. It seems >>>that >>> >>> >>> >>> >> >> >> >> >>>when I am in the middle of a workflow, there is no way to allow the >>>user to jump out of the workflow into another area of the application. >>> >>> > > > >>>I have tried specifying a * and a *.do as a nextPath parameter but >>> >>> >that > > >>> >>> >>> >>> >> >> >> >> >>>doesn't seem to work. Does anyone know how to gain a little more >>>flexibility with this framework? All I want to do is stop people from >>>jumping steps/entering into the middle of a workflow. At the moment, >>> >>> >it > > >>> >>> >>> >>> >> >> >> >> >>>seems that a user needs to enter a workflow and then complete that >>>workflow before a he/she can leave it. Does anyone have any >>> >>> >suggestions > > >>> >>> >>> >>> >> >> >> >> >>>how I can work around this? >>> >>>Thanks >>> >>>Jordan >>> >>> >>>-- >>>To unsubscribe, e-mail: >>> >>> >>> >>> >><mailto:[EMAIL PROTECTED]> >> >> >> >> >>>For additional commands, e-mail: >>><mailto:[EMAIL PROTECTED]> >>> >>> >>> >>> >>> >>> >>> >> >> >>-- >>To unsubscribe, e-mail: >><mailto:[EMAIL PROTECTED]> >>For additional commands, e-mail: >><mailto:[EMAIL PROTECTED]> >> >> >> >> >> > > > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>