You should be raising events and then having your handlers such as
]on("foo").to("baz")
activity.validate();
if (activity.hasErrors()) {
returns errors()
}
flow.activity = activity
return success()
} else {
flow.activityCommand = activityCommand
return error()
}
}
on("success").to "showBookingType"
on("back").to "showGeneralInformation"
on("error").to "showGeneralInformation"
}
On Wed, Jul 16, 2008 at 5:11 PM, Callaway, Pamela <
pcallaway@...> wrote:
> Hi folks,
>
>
>
> I have another webflow question. I have a flow that is kind of circular,
> meaning that I have to go back and forth between a couple of states until
> the users are done. However, I can't seem to go from one state to another
> inside of a state handler.
>
>
>
> The documentation seems to suggest you can just call the function of the
> state, but that doesn't seem to work… do I need a return in front of it or
> something?
>
>
>
> IE :
>
>
>
> Def myFlow = {
>
> doThing1 = {
>
> action {
>
> TheObject o = new TheObject()
>
> AnotherObject ao = new AnotherObject()
>
> Return ['theObject':o, 'otherObject':ao]
> //goes to the first gsp….
>
> }
>
> }
>
> doThing2 = {
>
> on("continue"){
>
> o.properties = params
>
> if(!o.save(flush:true))return error()
>
> }.to "doThing3"
>
> }
>
> doThing3 = {
>
> on('continue'){
>
> //save other stuff
>
> Ao.properties = params
>
> Ao.save()
>
> If(o.someproperty == "something
> specific') doThing2()
>
> }.to "summary"
>
> }
>
> summary = {
>
> //just show the summary page
>
> }
>
> }
>
>
>
> So the 'If(o.someproperty == "something specific') doThing2()' is where I'm
> trying to jump back to the "doThing2" state, but all it does is go to the
> summary….
>
>
>
> Any suggestions?
>
>
>
> Thanks,
>
>
>
> Pam
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email