Hello there.
I am developing a webapp using spring-webflow-pr5. My questions here are quot;am I doing this the best way?quot; and quot;do I need to be using a newer version of webflow from CVS?quot;
The situation is that I have a view-state from where the user can hit any of 5 links which I want to initialise a sub-flow, but before it goes there I want to set some state information (which I am storing in the from session as it must be there beyond flow scope).
At the moment I have 5 transitions from the view-state which each go to an action-state. The action-states are all similar and simply store some information in the from session, and then the action-state transitions to the sub-flow.
Also, am I right in thinking that from session is the best way to store this session information, or because I'm running within Spring (1.2.6) should I take advantage of some feature in that instead?
There is a second scenario in another flow where an action-state is executed and, based on the logic executed, it may flow to one of several possible view-states or action-states. I can store the quot;next flowquot; information in the flowscope, and then I have seen something about a decision-state which can get this information and then have multiple transitions, but this is not in PR5...do I need to upgrade or can this be done in PR5 in a way I haven't seen yet? Could I perhaps use an expression for the quot;toquot; part of the success transition after the action-state has executed? (e.g. lt;transition on=quot;successquot; to=quot;${flowScope.nextFlow}quot;/gt;)
Any advice appreciated.
Regards,
Dan
Also, am I right in thinking that from session is the best way to store this session information, or because I'm running within Spring (1.2.6) should I take advantage of some feature in that instead?
I think anything that lives beyond a flow should be stored within the session. Currently, within my application I am storing a tree structure which needs to live beyound any flows. It should always be present and not be initialize or re-initialized whenever my flow starts or ends. Besides, it would be a lot of data to serialized.
Reference/Lookup data, for example, I store in request scope, I only load it when I need it.
The things I normally store within flow scope are data that are needed by various states within my flow.
I have seen something about a decision-state which can get this information and then have multiple transitions, but this is not in PR5...do I need to upgrade or can this be done in PR5 in a way I haven't seen yet?
This is still possible in SWF-PR5 and definetly possible in RC1. Here is the following snippet taken from the SWF-PR5 sellitem example. Code:
lt;decision-state id=quot;requiresShippingquot;gt;
lt;if test=quot;${flowScope.sale.shipping}quot; then=quot;enterShippingDetailsquot; else=quot;showCostOverviewquot;/gt;
lt;/decision-stategt;
Hope this helps,_Curtney
Thanks for your response, Curtney. Looks like you've confirmed my session question (assuming we are both talking about from session), so thanks for that.
Regarding the multiple decisions to be made, I had assumed from the sellitem example that you could only have one if element. I did originally try multiple ifs but got errors. I've since checked the PR5 DTD and it does indeed say one or more if elements are allowed, so I must have made some other mistake. I'll try again tomorrow...
Regards,
Dan |