You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Axel Gross <ka...@iaeste.at> on 2003/10/22 09:56:51 UTC

Re: [Struts Workflow] Test application - why two actions for loop? [solved]

Thanks Mathias!

That makes everything clear.
I think you should do that documentation update, it's so crucial to workflow security
and at least I didn't get that point without asking :))

Dankeschön nochmals!
Axel

On 2003-10-21 at 09:21:08 +0200, Matthias Bauer wrote:
> Axel,
> 
> your suggestion unforunately does not work as you would expect.
> 
> The action definition you are suggesting defines nextState=2 and 
> newState=2. This means, that after the action has been executed, the wf1 
> is in state 2. Thus, any action that does not change the state of wf1 
> can be executed after this action, because the nextState definition is 
> satisfied, if the state does not change.
> 
> Maybe I should update the documentation with a rule like this:
> 
> "Never set a newState definition to the same value as one of the 
> nextState definitions, as this basically leaves the nextState definition 
> effectless."
> 
> Hope that answers your question.
> 
> --- Matthias
> 
> 
> Axel Gross wrote:
> 
> >Well.
> >
> >If you take a look at the struts-config.xml you'll see that there are two
> >actions defined:
> >wf1St2Loop
> >and
> >wf1St2LoopEnd
> >
> >The second is just a forward changing workflow values.
> >I just can't figure out a reason, why there are two instead of one simpler
> >action.
> >
> >for your convenience, original relevant part of struts-config.xml:
> ><!-- SNIPPET -->
> > <action path="/wf1St2Transition"
> >         type="com.livinglogic.struts.workflow.test.Wf1St2Action">
> >   <set-property property="authClass"
> >value="com.livinglogic.struts.workflow.test.TestAuthentication" />
> >   <set-property property="primaryWorkflow" value="wf1" />
> >   <set-property property="prevState" value="1" />
> >   <set-property property="newState" value="2" />
> >   <set-property property="nextState" value="2_loop" />
> >   <set-property property="nextState" value="3" />
> >   <forward name="success" path="/WEB-INF/web/inHome.jsp" />
> > </action>
> > 
> > <action path="/wf1St2Loop"
> >         type="com.livinglogic.struts.workflow.test.Wf1St2Action">
> >   <set-property property="authClass"
> >value="com.livinglogic.struts.workflow.test.TestAuthentication" />
> >   <set-property property="primaryWorkflow" value="wf1" />
> >   <set-property property="prevState" value="2" />
> >   <set-property property="newState" value="2_loop" />
> >   <set-property property="nextState" value="2" />
> >   <forward name="success" path="/wf1St2LoopEnd.do" />
> > </action>
> >
> > <action path="/wf1St2LoopEnd" forward="/WEB-INF/web/inHome.jsp">
> >   <set-property property="authClass"
> >value="com.livinglogic.struts.workflow.test.TestAuthentication" />
> >   <set-property property="primaryWorkflow" value="wf1" />
> >   <set-property property="prevState" value="2_loop" />
> >   <set-property property="newState" value="2" />
> >   <set-property property="nextState" value="2_loop" />
> >   <set-property property="nextState" value="3" />
> > </action>
> >
> > <action path="/wf1St3Transition"
> >
> >type="com.livinglogic.struts.workflow.AddSessionAttributeCleanupAction"
> >         parameter="pathWf1">
> >   <set-property property="authClass"
> >value="com.livinglogic.struts.workflow.test.TestAuthentication" />
> >   <set-property property="primaryWorkflow" value="wf1" />
> >   <set-property property="newState" value="3" />
> >   <forward name="success" path="/wf1St3TransitionPart2.do" />
> > </action>
> ><!-- SNIPPET END -->
> >
> >
> >What I suggest is killing the '2_loop' state:
> ><!-- SNIPPET -->
> > <action path="/wf1St2Loop"
> >         type="com.livinglogic.struts.workflow.test.Wf1St2Action">
> >   <set-property property="authClass"
> >value="com.livinglogic.struts.workflow.test.TestAuthentication" />
> >   <set-property property="primaryWorkflow" value="wf1" />
> >   <set-property property="prevState" value="2" />
> >   <set-property property="newState" value="2" />
> >   <set-property property="nextState" value="2" />
> >   <set-property property="nextState" value="3" />
> >   <forward name="success" path="/WEB-INF/web/inHome.jsp"" />
> > </action>
> ><!-- SNIPPET END -->
> >
> >On 2003-10-20 at 17:07:31 +0200, shirishchandra.sakhare@ubs.com wrote:
> > 
> >
> >>can you elaborate a little?
> >>Too less info :-((
> >>
> >>
> >>
> >>-----Original Message-----
> >>From: Axel Gross [mailto:kamikaze@iaeste.at]
> >>Sent: Monday, October 20, 2003 5:03 PM
> >>To: struts-user@jakarta.apache.org
> >>Subject: [Struts Workflow] Test application - why two actions for loop?
> >>
> >>
> >>Hello!
> >>
> >>I had a close look to the test application of the Struts Workflow 
> >>Extension
> >>(v 1.0.3).
> >>I still couldn't grasp though, why for loop in workflow "wf1" there is a
> >>need for 2 actions.
> >>Maybe you could help me finding out:
> >>Wouldn't it be enough to have
> >> prevState=2
> >> nextState=2
> >> nextState=3
> >> forward success -> inHome.jsp
> >>
> >>thanks in advance,
> >>Axel Gross
> >>   
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> > 
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
--  
********************************************************
     http://www.iaeste.at/~kamikaze/signature.html
********************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org