Iteration Action - modelint/shlaer-mellor-metamodel GitHub Wiki
Iteration is rarely used in Shlaer-Mellor Activities. Normally, if we have a set of instance references or tuples in a table, we can just feed them into one or more Actions which will operate on all of them. For example, if we want to send a signal to multiple instances, we just flow a set of instance references to a Signal Action.
But sometimes it is necessary to operate on the input elements in a specific order. This could be the case if you are writing data to a log in a particular order, or transferring units of data to specialized hardware.
To accomplish this, an input Instance Flow triggers the execution of a set of Actions, ordered by some specified Sequence, once per instance.
Here is an example in Scrall:
<< Point(*), /OR1/next >> {
DRIVER.Write( PointID : ID, Value )
}
In the example action language above, the top part in double angle brackets specifies both the Iteration Input and the Sequence. All instances of Point have been selected and they flow into the Iteration Action. The OR1
Ordinal Relationship, defined on the Point class, is traversed in the next
direction. That gives us the Sequence.
Inside the curly brackets we see a single External Entity Egress Action which accesses the ID and Value attributes of an instance of Point on each iteration.
Identifiers
- Action + Activity + Domain
Attributes
No non-referential attributes