OCLOperators allStates
Created by Lars.olofsson on 2017-08-13 · Last edited by Colline.ssali on 2025-12-29.
The allStates operator is a state-machineârelated OCL operation that returns all states defined for a class, including both simple and composite states. It is mainly used for model introspection, allowing you to query and work with the lifecycle or state machine associated with a class rather than its attribute data.
Returns names of all states in all state machines for this type.
Return Type
Collection(String)
Example:
Assume the Department class has a lifecycle (state machine) with the following states:
DraftActiveSuspendedClosed
Department.allStatesResults:
A collection containing:
Draft, Active, Suspended, Closed
