StateMachineTemplateTransition Method (String, String, String, Object) |
Namespace: StaMa
public void Transition( string name, string sourceState, string targetState, Object triggerEvent )
Exception | Condition |
---|---|
ArgumentNullException | The name is null or empty. |
ArgumentOutOfRangeException | The name is not a valid identifier for a Transition: The identifier of a Transition must start with a character followed by nonspace characters or digits. |
ArgumentOutOfRangeException | The name is not a unique: A Transition with the same name already exists within the StateMachineTemplate instance. |
StateMachineException | A syntax error was detected with this or the preceeding Region, EndRegion, State, EndState or Transition statements. |
The sourceState may only reference a State that is a sub-State of the anchor-State.
The targetState may reference any State within this StateMachineTemplate.
Usually the sourceState will be identical with the name of the State defined through the enclosing StateMachineTemplate.State Overload ... EndState statements.
In some cases it may be useful to define a Transition on a higher hierarchical level in order to raise the Transition's priority above other transitions that would otherwise be handled premptive due to their hierarchy level. For such cases the sourceState will reference a State that is hierachically nested within the immediate enclosing StateMachineTemplate.State Overload ... EndState statement pair.