Prev Next

Code Generation Macros for Executable StateMachines

The templates listed here are available through the Code Template Editor (the 'Code > Configure > Options > Edit Code Templates' ribbon option); select 'STM_C++_Structured' in the 'Language' field.

The templates are structured as follows:

StmContextStateMachineEnum

          StmStateMachineEnum

StmContextStateEnum

          StmAllStateEnum

StmContextTransitionEnum

          StmTransitionEnum

StmContextEntryEnum

          StmAllEntryEnum

StmContextStateMachineStringToEnum

          StmStateMachineStringToEnum

StmContextStateEnumToString

          StmStateEnumToString

StmContextTransitionEnumToString

          StmTransitionEnumToString

StmContextStateNameToGuid

          StmStateNameToGuid

StmContextTransitionNameToGuid

          StmTransitionNameToGuid

StmContextDefinition

          StmStateMachineEnum

          StmAllStateEnum

          StmTransitionEnum

          StmAllEntryEnum

          StmAllRegionVariableInitialize

          StmStateWithDeferredEvent

                    StmDeferredEvent

          StmTransitionProcMapping

          StmTransitionProc

                    StmTransitionExit

                    StmTransitionEntry

                    StmTargetOutgoingTransition

                    StmTargetParentSubmachineState

          StmStateProcMapping

          StmStateProc

                    StmStateEntry

                              StmOutgoingTransition

                              StmConnectionPointReferenceEntry

                              StmParameterizedInitial

                    StmSubMachineInitial

                    StmRegionInitial

                    StmRegionDeactive

                              StmStateExitProc

          StmStateTransition

                    StmStateEvent

                              StmStateTriggeredTransition

                    StmStateCompletionTransition

                    StmStateIncomingTransition

                    StmStateOutgoingTransition

                    StmSubmachineStateExitEvent

                              StmVertexOutgoingTransition

                              StmConnectionPointReferenceExitEvent

                    StmStateExitEvent

                              StmVertexOutgoingTransition

          StmAllRegionVariable

          StmStateMachineStringToEnum

          StmStateMachineRun

                    StmStateInitialData

                    StmStateMachineEntry

                              StmOutgoingTransition

          StmStateMachineRunInitial

                    StmStateMachineInitial

          StmStateMachineRuns

StmContextManager

StmSimulationManager

          StmContextInstanceDeclaration

          StmContextInstance

                    StmContextVariableRunstate

          StmContextInstanceAssociation

          StmContextInstanceClear

StmEventProxy

          StmSignalEnum

          StmContextJoinEventEnum

                    StmJoinEventEnum

          StmEventEnum

          StmSignalDefinition

                    StmSignalAttributeAssignment

                    StmSignalAttribute

          StmSignalInitialize

          StmEventStringToEnum

          StmEventEnumToString

          StmEventNameToGuid

StmConsoleManager

          StmContextInstanceDeclaration

          StmContextInstance

                    StmContextVariableRunstate

          StmContextInstanceAssociation

          StmContextInstanceClear

StmStateMachineStrongToEnum

StmInitialForTransition

StmVertextOutgoingTransition

StmSendEvent

StmBroadcastEvent

StmContextRef

Signal & Event

Macro name

Description

stmEventEnum

The name of the Event with the prefix 'ENUM_', all upper case.

StmEventGuid

The GUID of the Event.

stmEventName

The name of the Event with spaces and asterixes removed.

stmEventVariable

The name of the Event with the prefix 'm_' in lower case.

stmIsSignalEvent

Is 'T' if the element is a SignalEvent.

stmSignalEnum

The name of the Signal with the prefix 'ENUM_', all upper case.

stmSignalFirstEvent

The name of the Event with the prefix 'ENUM_', all upper case.

stmSignalGuid

The GUID of the Signal.

stmSignalName

The name of the Signal with spaces and asterixes removed.

stmSignalVariable

The name of the Signal with the prefix 'm_' in lower case.

stmTriggerName

Transition Properties: The name of the Trigger.

stmTriggerSpecification

Transition Properties: The specification of the Trigger.

stmTriggerType

Transition Properties: The type of the Trigger.

Context

Macro name

Description

stmContextName

The name of the Class with spaces and asterixes removed.

stmContextQualName

The qualified name of the Class for which code is being generated.

stmContextVariableName

stmContextFileName

The output file name for the Class for which code is being generated.

Writing Object Runstate to StateMachine Initialization

Macro name

Description

stmContextVariableRunstateName

stmContextVariableRunstateValue

stmContextHasStatemachine

Is 'T' if the current context has one or more StateMachines.

stmHasHistoryPattern

Is 'T' if the StateMachine has a History Pattern.

stmHasTerminatePattern

Is 'T' if the StateMachine has a Terminate Pattern.

stmHasDeferredEventPattern

Is 'T' if the StateMachine has a Deferred Event Pattern.

stmHasSubmachinePattern

Is 'T' if the StateMachine has a Submachine Pattern.

stmHasOrthogonalPattern

Is 'T' if the StateMachine has an Orthogonal Pattern.

StateMachine

Macro name

Description

stmStatemachineName

The name of the StateMachine with asterixes and spaces removed.

stmStatemachineEnum

The name of the StateMachine plus 'ENUM_' plus the name of the StateMachine in upper case.

stmStatemachineGuid

The GUID of the StateMachine element.

stmStateCount

The number of State elements in the StateMachine.

stmSubmachineInitialCount

The number of Initial elements in the Sub Machine State element.

stmStatemachineHasSubmachineState

Is 'T' if the StateMachine has at least one SubMachine State.

stmStatemachineInitialCount

The number of Initial elements in the StateMachine.

Region

Macro name

Description

stmRegionEnum

The name of the State Region plus 'ENUM_' plus the name of the State Region in upper case.

stmRegionFQName

The fully qualified name of the State Region.

stmRegionName

The name of the State Region with spaces and asterixes removed.

stmRegionVariable

The name of the State Region with the prefix 'm_' in lower case.

stmRegionFQVariable

The fully qualified name of the State Region with the prefix 'm_' in lower case.

stmRegionGuid

The GUID of the Region.

stmRegionInitial

stmRegionIsOwnedByStateMachine

Is 'T' if the Region is owned by a StateMachine.

Transition

Macro name

Description

stmTransitionEnum

The name of the Transition with the prefix 'ENUM_', plus the name of the Transition in upper case.

stmTransitionGuid

The GUID of the Transition.

stmTransitionName

The name of the Transition with spaces and asterixes removed.

stmTransitionSourceGuid

The GUID of the Source element in the Transition.

stmTransitionTargetGuid

The GUID of the Target element in the Transition.

stmTransitionVariable

The name of the Transition with the prefix 'm_' in lower case.

stmTransitionSourceVariable

stmTransitionTargetVariable

stmTransitionFQVariable

stmSourceVertexEnum

The name of the Transition's source vertex plus '_ENUM' plus the name of the Transition's source vertex in upper case.

stmTargetVertexEnum

The name of the Transition's target vertex plus '_ENUM' plus the name of the Transition's target vertex in upper case.

stmSourceIsInitial

Is 'T' if the Transition's source is an Initial.

stmSourceIsState

Is 'T' if the Transition's source is a State.

stmSourceIsEntryPoint

Is 'T' if the Transition's source is an Entry Point.

stmSourceIsExitPoint

Is 'T' if the Transition's source is an Exit Point.

stmSourceIsFork

Is 'T' if the Transition's source is a Fork.

stmSourceIsJoin

Is 'T' if the Transition's source is a Join element.

stmTargetIsFinalState

Is 'T' if the Transition's target is a Final State element.

stmTargetIsExitPoint

Is 'T' if the Transition's target is an Exit Point element.

stmTargetIsState

Is 'T' if the Transition's target is a State element.

stmTargetIsChoice

Is 'T' if the Transition's target is a Choice element.

stmTargetIsJunction

Is 'T' if the Transition's target is a Junction element.

stmTargetIsEntryPoint

Is 'T' if the Transition's target is an Entry Point element.

stmTargetIsConnectionPointReference

Is 'T' if the Transition's target is a Connection Point Reference element.

stmTargetIsFork

Is 'T' if the Transition's target is a Fork element.

stmTargetIsJoin

Is 'T' if the Transition's target is a Join element.

stmTransitionEffect

The Effect of the Transition.

stmTransitionGuard

The Guard of the Transition.

stmTransitionKind

The type or kind of the Transition.

stmTargetInitialTransition

stmTargetIsSubmachineState

Is 'T' if the Transition's target is a Submachine State.

stmSourceStateEnum

The name of the Transition's source state with the prefix '_ENUM' in upper case.

stmTargetStateEnum

The name of the Transition's target state, with the prefix '_ENUM' in upper case.

stmTargetVertexFQName

The fully qualified name of the Transition's target vertex.

stmTargetIsDeepHistory

Is 'T' if the Transition's target is a Deep History State.

stmTargetIsShallowHistory

Is 'T' if the Transition's target is a Shallow History State.

stmTargetIsTerminate

Is 'T' if the Transition's target is a Terminate element.

stmParentIsStateMachine

Is 'T' if the vertex is an Entry Point or Exit Point, or if the container is a StateMachine.

stmSourceParentStateEnum

stmTargetParentStateEnum

stmTargetSubmachineEnum

stmTargetRegionIndex

stmIsSelfTransition

Is 'T' if the Transition's source is the same as its target.

stmHistoryOwningRegionInitialTransition

stmDefaultHistoryTransition

Vertex and State

Macro name

Description

stmVertexName

The name of the Vertex.

stmStateName

The name of the State.

stmVertexGuid

The GUID of the Vertex.

stmVertexFQName

The fully qualified name of the Vertex.

stmStateFQName

The fully qualified name of the State.

stmVertexType

The type of the vertex; one of 'State', 'FinalState', 'Pseudostate', 'ConnectionPointReference' or ' ' (empty).

stmPseudostateKind

The kind of the Pseudostate; one of 'initial', 'deepHistory', 'shallowHistory', 'join', 'fork', 'junction', 'choice', 'entryPoint', 'exitPoint' or 'terminate'.

stmPseudostateName

The name of the Pseudostate.

stmPseudostateVariable

The name of the Pseudostate with the prefix 'm_' in lower case.

stmPseudostateStateMachineName

The name of the Pseudostate StateMachine.

stmPseudostateStateMachineVariable

The name of the Pseudostate StateMachine with the prefix 'm_' in lower case.

stmVertexVariable

The name of the Vertex with the prefix 'm_' in lower case.

stmVertexEnum

The name of the Vertex plus '_ENUM' plus the name of the Vertex in upper case.

stmStateEnum

The name of the State plus '_ENUM' plus the name of the State in upper case.

stmConnectionPointReferenceStateName

The name of the Connection Point Reference.

stmConnectionPointReferenceStateVariable

The name of the Connection Point Reference with the prefix 'm_' in lower case.

stmConnectionPointReferenceEntryCount

stmParameterizedInitialCount

stmInitialCountForTransition

stmStateVariable

The name of the State with the prefix 'm_' in lower case.

stmStateEntryBehavior

The behavior defined for an 'entry' Action operation for a State (the text on the 'Behavior' tab for the 'entry' Action operation on the Features window for the element).

stmStateEntryCode

The initial code defined for an 'entry' Action operation for a State (the text for the 'entry' Action operation on the Behavior's 'Code' tab).

stmStateDoBehavior

The behavior defined for a 'do' Action operation for a State (the text on the 'Behavior' tab for the 'do' Action operation on the Features window for the element).

stmStateDoCode

The initial code defined for a 'do' Action operation for a State (the text for the 'do' Action operation on the Behavior's 'Code' tab).

stmStateExitBehavior

The behavior defined for an 'exit' Action operation for a State (the text on the 'Behavior' tab for the 'exit' Action operation on the Features window for the element).

stmStateExitCode

The initial code defined for an 'exit' Action operation for a State (the text for the 'exit' Action operation on the Behavior's 'Code' tab).

stmStateSubmachineName

The name of the Submachine.

stmStateSubmachineVariable

The name of the Submachine with the prefix 'm_' in lower case.

stmStateIsFinal

Is 'T' if the State is a FinalState.

stmStateIsSubmachineState

Is 'T' if the State is a Submachine State ('Properties' page | Advanced | 'isSubmachineState' property).

stmSubMachineEnum

The name of the Submachine followed by '_ENUM' plus the name of Submachine in upper case.

stmStateHasChildrenToJoin

stmStateIsTransitionTarget

stmThisIsSource

stmThisIsSourceState

stmStateParentIsSubmachine

Is 'T' if the State's container is a StateMachine.

stmStateContainerMatchTransitionContainer

stmVertexRegionIndex

stmStateRegionCount

The number of regions in the State.

stmStateInitialCount

The number of Initial elements in the StateMachine.

stmVertexContainerVariable

stmVertexParentEnum

stmStateHasUnGuardedCompletionTransition

stmStateEventHasUnGuardedTransition

stmInitialTransition

Instance Association

Macro name

Description

stmSourceInstanceName

stmTargetInstanceName

stmSourceRoleName

stmTargetRoleName