R1052 - modelint/shlaer-mellor-metamodel GitHub Wiki

R1052 / 1:M

Switch Action selects one or many Case

Case is selected by exactly one Switch Action


During runtime, a Switch Action will enable ONE of multiple possible output Case Control Flows based on the detected input Match Value.

There is no need to supply a Case for every single value that an enumerated type may specify. Let's say that you are modeling a traffic signal and you want to stop a vehicle if the light is red or yellow and do nothing if the light is green. In that case a set of Actions may be enabled only in the first two Cases as shown below:

traffic signal? {
    .yellow, .red :
        stop -> vehicle  // don't do anything in the .green case
} 

Textually, you might lump the first two cases together in the same line, but that is just a convenience. The data flow semantics will recognize two distinct Cases that just happen to enable the same set of dependent Actions.

A given Case is, by definition, output by a single Switch Action.