SysMLv1: Cameo Simulation Toolkit: Cases for StateMachine Transitions with 'effect' Behaviors and/or States with 'entry' Behaviors triggered by a Signal with an attribute [with mini video]

Gallery
Tutorial

A Transition between States in a StateMachine can have an optional 'effect' Behavior:

A target State of the Transition can have an 'entry' Behavior:

In the case where the Transition is triggered by a Signal with attributes, the 'effect' or 'entry' Behavior should have 'in' parameters matching those Signal attributes.

What happens if you have both an 'effect' Behavior and an 'entry' Behavior? What happens if you have neither? What happens when the 'effect' or 'entry' Behavior parameters don't exactly match the Signal attributes? Some cases are explored here.

Click on the image to view it full size
Watch simulation
video_sim
Watch a high resolution version of the video on Vimeo.

Note that an 'effect' or 'entry' Behavior must be owned by its Transition or State, so you can't directly use a Behavior owned by the owner of the StateMachine; for such cases use wrapper Activities, which are indicated here related to their wrapped Activities using a custom Stereotype «wraps».

In the actual example shown, one doesn't really need the wrappers, because the wrapped Activities don't access the owning context EffectVsEntry of the StateMachine, they are just OpaqueBehaviors that print the value 'v'. But in general 'effect' or 'entry' Behaviors might need to access the owning context.

The tool MOSTLY looks after this "wrapping" for you:

But some tool actions "steal ownership" of such Behaviors! The example also shows some "pathological" cases. In Magic Model Analyst® (Cameo Simulation Toolkit®) one can in fact feed some inconsistent arguments into an 'effect' or 'entry' Behavior. The OpaqueBehavior StringArg with argument s:String accepts the v:Real without complaint! If you instead use an OpaqueBehavior BlockArg with argument b:FAILME - where FAILME is a Block - you at least get a warning like this:
WARN: Illegal value, '[6]' is not FAILME in Call Behavior Action.
But then it still prints the correct value anyway:
blockArg: b=6

There are also cases where the Signal TrigEffectOrEntry is not consumed at all. There is no Transition with trigger TrigEffectOrEntry from State HadEffectBlockArg. A warning is correctly issued to the simulation console:

WARN: the signal TrigEffectOrEntry has not been consumed and removed from the EffectVsEntry@493e7f2c pool

Learn SysML for MBSE with the Webel IT Australia Live Online web seminar or On-Site course!

Please email or phone Webel IT Australia on +61 405 029 008 to arrange On-Site, Off-Site, or Live Online remote web training seminars and workshops.
Up next
Notes
Snippets (quotes/extracts)
Visit also
Visit also (backlinks)
Related slides (includes other tutorials)
Related slides (backlinks, includes other tutorials)
External links