You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ROSSEL Olivier <ol...@airbus.com> on 2002/11/26 18:38:08 UTC

Managing a workflow with Struts-workflow.

I want to have a workflow which is

MainPage.do -> FirstStep.do -> SecondStep.do -> ThirdStep.do -> Result.do ->
MainPage.do
                          (1.jsp)                 (2.jsp)
(3.jsp)

where each step is supposed to fill one part of a big ActionForm.

I think each Step will test if the part of the ActionForm
it handles is already filled (then the current step must be skipped), 
and if so, it forwards to the next action.

Is it the good way to do the job?

I am not sure to see the benefit of using the workflow plug-in.
I declare the workflow in my struts-config.xml, but still have to hard 
code next/previous URLs in my JSPs.

The benefit is of course that the workflow detects if the user
broke the natural chaning by clicking several "Back" in his browser.
But if he did, he could have some reasons, and this may not be an error.

Well, I am sure I misunderstand something, but any help is welcome.

---cut here---


This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.
Security Notice: all e-mail, sent to or from this address, may be
accessed by someone other than the recipient, for system management and
security reasons. This access is controlled under Regulation of
Investigatory Powers Act 2000, Lawful Business Practises.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Managing a workflow with Struts-workflow.

Posted by Matthias Bauer <Ma...@livinglogic.de>.
Hi Olivier.

Let me first say this: The workflow extension is not meant to help you 
manage session data and dispatch actions depending on that session data.

Instead it can force the user to follow a sequence of actions that he is 
not allowed to leave. For example think of modal dialogs that are well 
known in desktop gui applications. There you have to click on a button 
the dialog offers before you can do something else in the application. 
One thing that makes web applications more difficult to handle is the 
fact, that you can not rely on a certain request being the next one, 
because the user can alway type in a new url or use the back or reload 
button.

Let's turn to your problem: It I get it right, you do not want to 
"punish" the user (e. g. by displaying an error screen), if he leaves 
this wizard like application. Instead you want to dispatch him depending 
on the data he has already filled in.

What I would recommend to you is this:

- keep an ActionForm in the user's session that collects all the data 
the user has filled in
- in the action form you also keep the  state information which step has 
to be executed next (step1, step2, step3)
- create a wizard-dispatcher that decides where to forward to (depending 
on the state information)


This would look like this:

MainPage.do -> dispatch.do -> 1.jsp -> submitFirstStep.do -> 2.jsp -> 
submitSecondStep.do -> 3.jsp -> submitThirdStep.do -> result.jsp

If someone executes dispatch.do when already having executed 
submitFirstStep.do the state information would be "step2" which results in
-> dispatch.do -> 2.jsp -> ...

You don't have to hard-code the urls into the dispatch action. Instead 
you just need to define forwards for "step1", "step2", ... in the 
struts-config.xml. All the dispatch action does is finding the right 
forward.

I think this is very easy. You don't need an additional framework for 
that...

--- Matthias



ROSSEL Olivier wrote:

>I want to have a workflow which is
>
>MainPage.do -> FirstStep.do -> SecondStep.do -> ThirdStep.do -> Result.do ->
>MainPage.do
>                          (1.jsp)                 (2.jsp)
>(3.jsp)
>
>where each step is supposed to fill one part of a big ActionForm.
>
>I think each Step will test if the part of the ActionForm
>it handles is already filled (then the current step must be skipped), 
>and if so, it forwards to the next action.
>
>Is it the good way to do the job?
>
>I am not sure to see the benefit of using the workflow plug-in.
>I declare the workflow in my struts-config.xml, but still have to hard 
>code next/previous URLs in my JSPs.
>
>The benefit is of course that the workflow detects if the user
>broke the natural chaning by clicking several "Back" in his browser.
>But if he did, he could have some reasons, and this may not be an error.
>
>Well, I am sure I misunderstand something, but any help is welcome.
>
>---cut here---
>
>
>This e-mail is intended only for the above addressee. It may contain
>privileged information. If you are not the addressee you must not copy,
>distribute, disclose or use any of the information in it. If you have
>received it in error please delete it and immediately notify the sender.
>Security Notice: all e-mail, sent to or from this address, may be
>accessed by someone other than the recipient, for system management and
>security reasons. This access is controlled under Regulation of
>Investigatory Powers Act 2000, Lawful Business Practises.
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>  
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>