public class TransitionMap
extends java.lang.Object
Holds the definition of the FSM (Finite State Machine) associated with a
particular Activity
type. There are two kinds of transitions
that can be associated with an activity:
Constructor and Description |
---|
TransitionMap() |
Modifier and Type | Method and Description |
---|---|
Transition |
getTransition(WorkflowStateConstant fromState,
Activity fromActivity,
WorkflowStateConstant atActivityState) |
Transition |
getTransition(WorkflowStateConstant fromState,
Json messageAttributes)
Try to find an appropriate transition given the set of message attributes.
|
void |
setTransition(WorkflowStateConstant fromState,
java.util.Map<java.lang.String,java.lang.String> messageAttributes,
Transition transition) |
void |
setTransition(WorkflowStateConstant fromState,
java.lang.String subActivityType,
WorkflowStateConstant atSubActivityState,
Transition t) |
public Transition getTransition(WorkflowStateConstant fromState, Json messageAttributes)
Try to find an appropriate transition given the set of message attributes. Transition defines for each of the attributes are considered and only if a unique matching transition can be determined, it will be returned. Otherwise, an exception is thrown. Unique matching is determined as follows:
A
, consider the set of transitions
S(A)
defined for it. Ignore attributes for which no transitions have
been defined.I
of all those sets S(A)
.S(A)
interest into a single transition T
,
i.e. if I
has only one element, then that transition is returned.I
has no element that means that attributes point to different
transitions and there's ambiguity - we throw an exception.I
has more than one transition in it, then we try to find the
unique one (if any) that is pointed exactly by the set of all A
s and by nothing
else.
ontology
attribute. One could then define a third transition that's based solely on the
performative=X
attribute and that handles all other cases where
ontology != Y
and ontology != Z
.
fromState
- messageAttributes
- public void setTransition(WorkflowStateConstant fromState, java.util.Map<java.lang.String,java.lang.String> messageAttributes, Transition transition)
public Transition getTransition(WorkflowStateConstant fromState, Activity fromActivity, WorkflowStateConstant atActivityState)
public void setTransition(WorkflowStateConstant fromState, java.lang.String subActivityType, WorkflowStateConstant atSubActivityState, Transition t)