|
From: Keith D. <ke...@in...> - 2005-03-29 04:16:14
|
After some discussion, I refined the support below to:
addActionState("bindAndValidateCriteria",
method("bindAndValidate",
action("person.Search.criteria.formAction")),
new Transition[] {
on(error(), "viewCriteria"),
on(success(), "executeQuery")
});
Which is arguably better, saying execute the "bindAndValidate" method on the
action identified by "person.Search.criteria.formAction" when the state is
entered.
With that, I'd like to start preparing the 1.2 web flow preview release.
For you guys already using the system, be sure to give a good review /
sanity test tomorrow and let me know if there are issues.
Thanks,
Keith
_____
From: Keith Donald [mailto:ke...@in...]
Sent: Monday, March 28, 2005 8:39 PM
To: 'spr...@li...'
Subject: enhanced flow multi action support
Hey guys,
I added more power to the multi-action implementation to spring web flow
this evening, for dispatching related controller logic to different methods
on a single target action object.
Essentially, you can now more flexibly map action states to handler methods,
so when a state is entered a specific target method will be invoked. This
lets the state definitions drive workflow - which are their strength - while
the action handlers concentrate on executing some processing and returning a
result.
For example, from Phonebook:
addActionState("bindAndValidateCriteria",
name(multiAction("person.Search.criteria.formAction"),
"bindAndValidate"),
new Transition[] {
on(error(), "viewCriteria"),
on(success(), "executeQuery")
});
The above reads "for the flow being built, add an action state with the id
'bindAndValidateCriteria'. Name the action 'bindAndValidate' and use the
multi-action implementation with bean id "person.Search.bindAndValidate"."
At runtime, when the above action state is entered, the selected
multi-action implementation will execute and dispatch to a single handler
method. The handler method to use will be resolved based on the assigned
name property above - in this case, "bindAndValidate". Arbitrary
properties are also supported, so you can store and act on whatever further
information you like about an action associated with a single action state.
We'll enhance the XML DTD to support arbitrary action state properties as
well.
Keith
Keith Donald
Interface21 - http://www.springframework.com
<http://www.springframework.com/> - Spring Training, Consulting and Support
- "From the Source"
|