Action changes
Cantor, Scott
cantor.2 at osu.edu
Thu Apr 24 20:05:05 EDT 2014
Summary of the changes I checked in:
Actions now return nothing (a null event) when they have nothing to
signal, which is the normal case. I've ported the PROCEED methods all over
to reflect this, but I figure we can leave them in so that the code
contract is insulated from the Event contract. (Seeing as I just changed
this without having to touch any actions, this seems useful to keep.)
Flows now use global transitions that act on any event not called
"proceed", so any time an action returns something, it needs to be handled
inside the <action-state> or it will trigger an error transition. Very
bad, confusing things happen when you don't do this right, but those are
flow authoring mistakes, not runtime problems once things are defined
correctly.
Most action states also have to explicitly evaluate 'proceed' so that the
final success transition will be of that type, the exceptions being cases
where there are special events used to control flow.
Finally, I understand better how event tracking works in SWF. The flow
engine will not overwrite the "currentEvent" property until an actual
event occurs, so a null event doesn't clear that state. This works better
when you don't return "success" or "proceed" signals, so that's another
advantage of this change. It means that only significant occurrences will
affect the currentEvent, which means I was able to get rid of all the code
I added to save off that event for error processing. Since I hated to add
that code, that was a sign this was a good change.
I mirrored this behavior in the OpenSAML handling of the event contexts.
Any EventContext present is converted to PreviousEventContext at the
beginning of action execution, but the absence of an EventContext means
nothing is touched. So the last Event tracked remains the PreviousEvent,
matching SWF's model.
There's more to do (e.g. the flow-pattern change if we do that), but this
was a good step in cleaning everything up.
I also have error handling working now for front and back channel
profiles, the rest is the detailed work of adjusting log levels and
creating new events for important error cases, but nothing structural.
-- Scott
More information about the dev
mailing list