> Hi everyone,
>
> I have a case in my application where I would like to be able to decide
> real-time to which use case to forward next. To explain my problem in a
> bit more details: I have something like a wizard which contains a
> dynamic number of steps. Instead of modelling each possible combination
> I would like to have some sort of dynamic forwarding. This means that
> for instance a method on the controller class is called getNextUseCase()
> which returns the id of the use case to which I want to forward.
>
> Because every use case is defined as a global forward this should
> technically be possible?! Is there a way to model such a situation?
>
> The only solution I can think of right now is to have a seperate use
> case "determine next use case" which contains a decision point and an
> exit state for each possible next use case. Then each use case (that is
> part of the wizard) forwards to this use case and then this specific use
> case determines the next and picks the right one. The only drawback is
> that for each new use case I would also have to change this specific use
> case that determines the possible next step? Any ideas?
>

what you could do is write a method that allows to take a parameter and
map it to a forward (to which is actually forward control), this can be a
static method somewhere in a helper class

next what you can do is make the final states forward control to an
external resource, you can do that by entering a value like
http://www.mysite.com/resource instead of the name of the target use-case
(there was a jira issue about this that I implemented a while back:
http://team.andromda.org:8080/jira/ViewIssue.jspa?key=BPM-96)

make it point to something that will handle the lookup and execution of
the appropriate forward, this could be a servlet that simply calls your
static method

that way you don't need to change anything when adding a new use-case, as
long as the global forward is known in the struts-config.xml your static
method should be able to resolve it and forward control to it

does this make sense ? let me know otherwise..

good luck
-- Wouter



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Andromda-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to