Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Content layer
id381703861
Content column
id381703863
Content block
id381703862

A State Invariant is one of the UML elements. It is a runtime constraint applied to a lifeline in a Sequence diagram to specify conditions that are always true when a State is a current State. It is used to validate States. You may also specify State Invariants in the States directly. State Invariants on lifelines resolves variables in the same order as it does in message arguments. 

When Cameo Simulation Toolkit runs a State Invariant in a model, it also evaluates its constraints. If the constraints are not satisfied, the evaluation will fail or return false and Cameo Simulation Toolkit will stop simulation (if "ConstraintAsBreakpoint" is set to true) at that invalid constraint or point. However, you can still continue the simulation to the next point. You can define constraints using any of the supported languages in Cameo Simulation Toolkit. State Invariants are used mostly in Interactions, but you can also use them in a State Machine diagram. Image Removed


Image Added

A State Invariant containing constraints being evaluated during execution.

Cameo Simulation Toolkit supports duration constraints between State invariants. The  The following figure shows the duration constraint, e.g., from State S1 to S2 takes 20 seconds of total simulation time; 10 seconds from duration constrains of the a Activity and another 10 seconds out of {15s} duration constrains. From State S3 to S4 takes 15 seconds of simulation time out of {15s} duration constraint.Image Removed playing to off takes 5,000 ms of the total simulation time.

Image Added

Duration constraints between State invariants are supported.
Content block
id381703860

Related pages