Click or drag to resize
StaMaStateMachineTemplateTransition Method (String, String, String, Object, StateMachineGuardCallback, StateMachineActionCallback)
Defines a transition emanating from state defined through the enclosing State(String)...EndState calls.

Namespace: StaMa
Assembly: StaMa (in StaMa.dll) Version: 2.3.1.7
Syntax
public void Transition(
	string name,
	string[] sourceStates,
	string[] targetStates,
	Object triggerEvent,
	StateMachineGuardCallback guard,
	StateMachineActionCallback transitionAction
)

Parameters

name
Type: SystemString
The name of the Transition to be created. Must be unique within the StateMachineTemplate.
sourceStates
Type: SystemString
A list of names of the transition source states.
targetStates
Type: SystemString
A list of names of the transition target states.
triggerEvent
Type: SystemObject
A Object that represents the trigger event that will execute the transition or null to indicate an "any" transition. See also SendTriggerEvent(Object).
guard
Type: StaMaStateMachineGuardCallback
A StateMachineGuardCallback delegate that provides additional conditions for the transition; otherwise, null if no addititional conditions are neccessary.
transitionAction
Type: StaMaStateMachineActionCallback
A StateMachineActionCallback delegate that will be called when the transition is executed. May be null if no transition action is required.
Exceptions
ExceptionCondition
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.
Remarks

The source state may only reference a state or state configuration of sub-states of the anchor state.

The target state may reference any state or state configuration within the state machine template.

Usually the source state will be identical with the name of the State defined through the enclosing State(String) call. In some cases it may be useful to define a transition on a higher hierarchical level in order to raise its priority above other transitions that are handled premptive due to their hierarchy level. For such cases the sourceStates may reference a set of State instances on a hierarchical lower layer than the immediate State parent.

See Also