Affects Version/s: 3.0-RC1
Fix Version/s: 3.0-RC2
I have a small problem with passing parameters between use cases. In 1st
use case I have a <<FrontEndView>> with outgoing
"Edit(idFoo:datatype::Long)" transition pointing to final state
On 2nd use-case (editFooUseCase), there's Initial state, transition to
action "Get foo information", which contains call event to to method
(let's call it getFooInformation(); this method has idFoo:datatype::Long
parameter) which retreives data for Foo object with received idFoo.
The problem is, that if I fill the idFoo edit on the first page's
generated form and press "edit" button, the received idFoo on 2nd
usecase is null. However, if I set the idFoo parameter explicitly in
browser's URL, everything works fine, idFoo is transfered to second use
case and can be used in getFooInformation() defered method succesfully.
Form on 1st usecase's page is generated like:
<form name="someNameForm" method="post" action="/some/action.do"...>
<input type="text" name="idFoo" value="" onmous...../>
..and if I set idFoo edit in it and press edit button, it doesn't work.
However http://localhost:8080/some/action.do?idFoo=1 works just fine.
------------------------- Wouter: ------------------------------------
the parameters from the first usecase are stored in form X in request
scope, so $request.x.myParam
the parameters from the second usecase are stored in form Y in request
scope, so $request.y.myParam
that's why it seems you cannot get hold of the Y values when you are
posting form X.
when appending the values as query parameters straight in the URL you
actually store them into request scope directly, for both usecases Struts
will properly populate the forms, so you have access to this query
parameter in three ways:
I never actually used passing parameter between usecases that much myself,
but I do want to solve your problem. In order to do that we would need to
find a way to tell Struts to populate form Y (although it just finished
populating form X)
I need to investigate this further, I also need to validate what I just
explained because I'm not 100% sure of it
in the meantime you should be able to do this in your usecase's Y controller:
can you file a jira issue for this, when I have a little more time I will
get to the bottom of this and make sure it works, it's not really a
bpm4struts bug, it's rather a Struts side-effect we need to work-around