I just started looking at struts 4 days ago, so please  bear with me...

This question really gets into workflow management.

I have a certain action that would be reused frequently across my site.
I want to route to that action from many other actions and then return
both control and information back to the calling action.  i.e., Actions
A,B,C and D transfer control to Action x.  Once x has done its work, I
need for x to route control back to A, B, C or D appropriately and to
provide some "new" request information that was gathered during Action x
to these Actions A,B,C or D.  The problem is that actions A,B,C and D
all have different interfaces on their beans so it might be a little
challenging to have 'x' simply know which methods on bean A,B,C or D to
use. I think I might want to use a mediator to handle the interactions
between the beans for A,B,C,D and X

i.e. action flow control works like this...
A <--> x
B <--> x
C <--> x
D <--> x


It seems to me that one way to do this is to:
1. Have A, B, C or D place a Mediator-pattern object in the request
2. Have A,B,C and D forward (& redirect the request) to action x.
3. Action x would look for the Mediator object under a certain key and
would use the mediator to access information from bean A,B,C or D while
x does its work.
4. When x finishes, it would then update the mediator which would update
the original Bean used by A,B,C or D
5. Finally, x would ask the mediator for the message that would be
needed to restart the original action and would redirect the user back
there.

Has anyone else tried to solve this problem differently? similarly? more
or less happily?

thanks,
--Michael




Reply via email to