R1026 - modelint/shlaer-mellor-metamodel GitHub Wiki

R1026 / 1:1

Iteration Action executes actions in exactly one Sequence

Sequence defines execution order for exactly one Iteration Action


The Sequence defines the order in which an Iteration Action executes its set of Actions. An ordering must be specified even if that order does not define an unambiguous sequence. In fact, it is possible to define an arbitrary Sequence. This case might be useful if the ordering doesn't matter, but you still want to execute a set of actions once per instance such that the entire set of actions runs to completion before processing the next instance.

CAREFUL: If what you really want to say is that a set of Actions must be executed per instance, but it would be okay if each instance were processed simultaneously, do not use an Iteration Action. Instead just flow the instance set as input directly to each Action in the set. Don't fall back on the implementation/programmer mindset where processing a set of elements implies iteration.

A Sequence is tailor made for a specific Iteration Action.

Formalization

Sequence.(Iteration action, Activity, Domain) -> Iteration Action.(Action, Activity, Domain)