R983 - modelint/shlaer-mellor-metamodel GitHub Wiki
R983 / 1:1c
Delete Action deletes instances referenced in exactly one Instance Flow
Instance Flow is source of instances to zero or one Delete Action
Within an Activity, an Instance Flow either specifies deletion, by flowing its instance references into a Delete Action, or it doesn't. Even with conditional logic as shown below, a single Instance Flow is input to a single Delete Action (even though this same action is referenced twice in the example).
annoyed with cats? {
doA()
!*cats // first delete action
} : {
doB() // eh, get rid of them anyway
!*cats // same delete action, just triggered by a different control flow
}
To ensure relationship integrity, it may be necessary to delete multiple sets of instances, from different classes.
For example, if we want to delete a pair of related super and subclass instances, we can't risk leaving one of them (the superclass instance) sitting around without any sublcass instance. The same goes for any chain of unconditional assocations.
For example:
!* dead siamese cat, dead siamese cat/R17/Cat // delete instance of Siamese Cat and Cat together
Here we use a single Scrall delete statement, but multiple delete actions will be created, one per input instance set. Since the deletions occur in the context of a single Activity, we know that both super and subclass instances will be deleted when the Activity completes.
If we want to ensure that no certain Actions within the same Activity wait before accessing the Cat
instances, we can make use of a Sequence Flow to ensure that all deletions complete before those other Actions proceed.