Commons Chain Alternate Flows

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Commons Chain Alternate Flows

dave.hallam
Hi,
 
I'm using Commons Chain to execute a series of commands.  What I'm
trying to ascertain is if it is possible to add alternate flows (e.g.
exception cases) to the chain config XML file.  Currently my chain
contains a serial list of commands to execute with a common context.
I'd like to be able to define alternate chains to execute under
conditions such as exception cases but without the command that threw
the exception (or set a flag) knowing what the chain configuration was
set to - i.e. it should all be defined in the chain config - not in the
code.
 
Has anyone done this?
 
Many thanks.
 
Dave Hallam
 
Reply | Threaded
Open this post in threaded view
|

Re: Commons Chain Alternate Flows

Mattias Jiderhamn-2
At 2005-05-27 16:26, you wrote:
>I'm using Commons Chain to execute a series of commands.  What I'm
>trying to ascertain is if it is possible to add alternate flows (e.g.
>exception cases) to the chain config XML file.  Currently my chain
>contains a serial list of commands to execute with a common context.
>I'd like to be able to define alternate chains to execute under
>conditions such as exception cases but without the command that threw
>the exception (or set a flag) knowing what the chain configuration was
>set to - i.e. it should all be defined in the chain config - not in the
>code.

Not really sure I understand the problem, but maybe you could create a
"conditional" Filter, that handles this for you, and then set the different
chains on this Filter (like "normal chain", "chain if exception"). This
will not be configurable by Chain XML config, but you could use Spring.

>Has anyone done this?

Haven't tried this myself though.

   /Mattias Jiderhamn


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Commons Chain Alternate Flows

Marco Mistroni
Hello,
        There's an article by Bill Siggelkow that explains how to
override a chain of commands with your own chain.. though that is
Struts-related..
Maybe can you reuse it?

I don't remember URL, but I m sure you will find easily with a google
search

Regards
        marco

-----Original Message-----
From: Mattias J [mailto:[hidden email]]
Sent: 27 May 2005 15:43
To: Jakarta Commons Users List
Subject: Re: Commons Chain Alternate Flows

At 2005-05-27 16:26, you wrote:
>I'm using Commons Chain to execute a series of commands.  What I'm
>trying to ascertain is if it is possible to add alternate flows (e.g.
>exception cases) to the chain config XML file.  Currently my chain
>contains a serial list of commands to execute with a common context.
>I'd like to be able to define alternate chains to execute under
>conditions such as exception cases but without the command that threw
>the exception (or set a flag) knowing what the chain configuration was
>set to - i.e. it should all be defined in the chain config - not in the
>code.

Not really sure I understand the problem, but maybe you could create a
"conditional" Filter, that handles this for you, and then set the
different
chains on this Filter (like "normal chain", "chain if exception"). This
will not be configurable by Chain XML config, but you could use Spring.

>Has anyone done this?

Haven't tried this myself though.

   /Mattias Jiderhamn


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]