commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dario D <darac1...@gmail.com>
Subject [scxml] Questions about error events and setting workflow state
Date Thu, 12 May 2011 10:56:26 GMT
We're developing an application which will use SCXML for its workflow and I
would ask you for advice on a couple of topics:

1) All workflows will have a single state which is called "error". Whenever
a custom action catches an error, it will fire a derived event and this will
cause the workflow go to the "error" state. Is it possible to expand this
functionality to other execution errors? For example when an assignment is
made to an undefined variable, or when an expression error happens, to fire
an error event. I've tried making transitions that listen to "error.*" (
http://www.w3.org/TR/scxml/#ErrorEvents) but they are not being used. I was
also hoping to raise this event from ErrorReporter but we don't have a
mechanism to raise events from there.

2) One requirement for the application is to allow setting an arbitrary
state in a workflow. For example, if we have the following workflow:

A->B->C->D->E

and the workflow is currently in state D, a user should be able to move the
workflow back to state B (or any other state). We were considering to use
the following way (from the mailing list archives):

public void setState(String state) {
    Set states = getCurrentStatus().getStates();
    TransitionTarget tt = getStateMachine().getTargets().get(state);
    states.clear();
    states.add(tt);
}

Would you recommend doing it this way and how would this affect on any
context which was previously set?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message