My question is similar to http://forum.springframework.org/showthread.php?t=38438 but with a twist...
I need to pass back an object reference from a bean method in the case of success, so it can be added to the flow or conversation scope (not sure which yet).
Specifically I am implementing an action state called 'doLogin', which invokes my service bean's doLogin(...) method with a form backing object set up by a previous state. This method needs to return three possible types of result - 'success', 'authMismatch', 'noSuchEntry' - and in the case of 'success' it needs to pass back the domain object (POJO) referring to the user's record.
If I were just returning an Enum, I could do this:-
<bean-action bean="serviceBean" method="doLogin">
<transition on="success" to="loggedIn" />
<transition on="authMismatch" to="start" />
<transition on="noSuchEntry" to="start" />
But I need my domain object, which is where I'm stuck. I can return a composite object that combines the domain object with the enum, but the default result conversion rules (Table 2.11) mean I will always get "success" as my event identifier.
Do I need to provide my own ResultEventFactory? How do I do that in the flow XML? Can this put the domain object into the appropriate scope?
Or am I going about this all the wrong way?!?