Hi Jerry,

sorry for responding this late, but I did not check my mails between christmas and new year.

Concerning your question: There is not very much support in the workflow extension to deal with your situation. The workflow extension allows you to define a "controlflowexception" forward either globally and/or for each action. But this is not what you want. If I got you right, you want to handle control flow exceptions depending on the state you are currently in, when the workflow violation happens.

Here is just an idea that might aim in the right direction:

1. Change the global control flow exception forward definition like so:

<!-- this happens, if the workflow data do not match -->
<forward name="controlflowexception" path="/handleControlFlowException.do"/>

2. Define an action, the global forward points to:

<action path="/handleControlFlowException"
type="your.own.package.HandleControlFlowException">
</action>

3. Globally define a forward for each workflow, sticking to a naming convention, e. g.:
<forward name="controlflowexception:wf1" path="/wf1ControlFlowException.jspp"/>
<forward name="controlflowexception:wf2" path="/wf2ControlFlowException.jspp"/>
<forward name="controlflowexception:wf3" path="/wf3ControlFlowException.jspp"/>

4. Implement the class HandleControlFlowException, which needs to determine, where to forward to according to the naming convention. How this is determined, depends on the mechanism you have in mind. And this is where I am not quite clear about: What is the exact condition to forward to wf1, wf2 or wf3 exception page?

This is just what came to my mind, when I read your question, so I wanted to share it. I don't know if it helps you, or if I even got you right. Again: I don't really get what the conditions should be to decide which exception page to display, because it could also be the secondary workflow that causes the exception.

--- Matthias


Jerry Yu wrote:

Hi Matthias,

I finally figure almost all the things I need to use workflow. Thanks for you example about how to go back a page :p Now I have another question. When the user is not following the flow, it will throws a ControlFlowException. How can I customize this exception? Situation is I have couple work flows in the project. And I don't want them to all go to the same page when there is an flow exception. My main problem is how can I seperate different flow exception by different work flow.

Right now my works are like this:
wf1a -> wflb -> if flow errors -> wf1 exception page
wf2a -> wf2b -> if flow errors -> wf1 exception page
wf3a -> wf3b -> if flow errors -> wf1 exception page

What i want to do:
wf1a -> wflb -> if flow errors -> wf1 exception page
wf2a -> wf2b -> if flow errors -> wf2 exception page
wf3a -> wf3b -> if flow errors -> wf3 exception page

Thanks,
Jerry



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to