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, [EMAIL PROTECTED] wrote:
can you elaborate a little? Too less info :-((
-----Original Message----- From: Axel Gross [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 5:03 PM To: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

