Skip to content

Subclass Switch Action

Leon Starr edited this page May 14, 2022 · 3 revisions

For any given Generalization, an enumerated type can be automatically generated based on the set of Subclass names. Each assignable value corresponds to a Subclass name in the specified Generalization.

With that capability, the modeler can then simply specify an instance of a Superclass and the associated Generalization. A subclass switch action can then be defined where each Case corresponds to one of the Subclass names. In this manner the modeler can then defines a distinct set of Actions to enable depending on a Superclass instance's related Subclass.

Here's an example with Scrall notation:

R38? {
    .Top Bank Level:
        // If this is a top level and down is requested, clear the down request
        // set/unset are type specific operators defined on the Boolean type
        (in.dir == .down) /R38/Top Bank Level.Calling down.unset
    .Bottom Bank Level:
        // If this is a bottom level and up is requested, clear the up request
        (in.dir == .up) /R38/Bottom Bank Level.Calling up.unset
    .Middle Bank Level:
        in.dir? {
            // If this is a middle level and up is requested, clear up
            // If this is a middle level and down is requested, clear up
            .up: /R38/Middle Bank Level.Calling up.unset
            .down: /R38/Middle Bank Level.Calling down.unset
        }
}

Identifiers

  1. Action + Activity + Domain

Attributes

No non-referential attributes

Clone this wiki locally