Skip to content

Signal to each member of an instance set

Leon Starr edited this page Nov 6, 2023 · 3 revisions

The signaling of an event is expressed with the -> symbol. Here a signal is sent from a Cabin instance to its associated Door instance.

Unlock -> /R4/Door

One signal is sent to each instance in the target selection.

Take out of service -> my bank/R1/Shaft // All Shafts in the Bank are deactivated

The ME keyword is used when the target of the signal is the local instance.

Continue -> ME  // Move self on to the next state

You need to first select the destination instances, via navigation, criteria based selection or both so that you can address the signal. If you end up with the empty set in your selection, no signal will be sent. You will often want to specify some action to be executed in the case where zero target instances were selected. You will need an instance set variable to test the cardinality as shown:

ac to land .= Aircraft( Tail number: in.aircraft to land )
Land ( Runway: designated runway ) -> ac to land
!ac to land ? No aircraft to land -> ME

The above works, but here is a more readable, and hence preferable, formulation:

ac to land .= Aircraft( Tail number: in.aircraft to land )
ac to land ?
    Land ( Runway: designated runway ) -> ac to land :
    No aircraft to land -> ME

Introduction

Model semantics

Flows (as Variables)

Constants and literals

Structure of an activity

Accessing the class model

Data flow


Grammar and parsing notes

Components

Clone this wiki locally