Statecharts Termination states A termination state provides local termination semantics. Local termination implies the completion of a composite state without the destruction of the context instance. There are two different modes for local termination: Љ Statechart mode where local termination applies only to composite states with final activities inside them. Љ Activity diagram mode where local termination applies to every block and composite state, even those that do not have internal final activities.
(This is the UML statechart/ activity diagram-supported mode.) The CG::Statechart::LocalTerminationSemantics property specifies whether activity diagram mode of local termination is available. The default value of Cleared means that the activity diagram mode of local termination is unavailable (statechart mode is active). Local termination code with the reusable statechart implementation The following sections describe how code is generated to support local termination when you use the reusable statechart implementation. Or states in reusable statechart Code is generated for local termination of Or states with the reusable statechart implementation as follows:
Љ For each final activity, a Concept class data member of type FinalState is generated. A new class is not created as for other state types. Љ The following local termination guard is added to each outgoing null transition from an Or state that needs local termination semantics: && IS_COMPLETED(state) Љ If an Or state has several final activities, an outgoing null transition is activated when any one of them is reached. However, the specific connector is instrumented. Љ The isCompleted() function is overridden for an Or state that has a final activity, returning True when the final activity is reached.
The function is also overridden for an Or state without a final activity in activity diagram mode, always returning False . Љ An instance of a FinalState is created by a line similar to the following example: FinalA = new FinalState(this, OrState, rootState, “ROOT.OrState.FinalA”); 732 User Guide