The FWStateMachine Stereotype

This section defines the constraints applicable to the <<FWStateMachine>> stereotype. Each constraint is defined in a dedicated subsection.

EntryPointConstraint

Description: The state machine has no entry points.

OCL:

self.connectionPoint->select(p|p.kind=PseudostateKind::entryPoint)->size()=0

UML2 API:

for (Iterator connectionPoints = object.getConnectionPoints().iterator();

connectionPoints.hasNext();) {

Pseudostate pseudostate = (Pseudostate)connectionPoints.next();

if (pseudostate.getKind().getValue() == PseudostateKind.ENTRY_POINT)

return false;

}

return true;

ExitPointConstraint

Description: The state machine has no exit points.

OCL:

self.connectionPoint->select(p|p.kind=PseudostateKind::exitPoint)->size()=0

UML2 API:

for (Iterator connectionPoints = object.getConnectionPoints().iterator();

connectionPoints.hasNext();) {

Pseudostate pseudostate = (Pseudostate)connectionPoints.next();

if (pseudostate.getKind().getValue() == PseudostateKind.EXIT_POINT)

return false;

}

return true;

RegionConstraint

Description: The state machine has only one region.

OCL:

self.region->size() = 1

UML2 API:

if (object.getRegions().size()==1){

return true;

}

return false;

StateAndTransitionExtentionConstraint

Description: New states and transitions of an inherited (extended) state machine can be only added (embedded) to simple states of a base state machine.

OCL:

This guard constraint cannot be described by OCL.

UML2 API:

if (validatorHelper.isExtendedStateMachine(object)){

if (!validatorHelper.checkStateAndTransitionExtention(object))

return false;

}

return true;