Adding or removing tagged values in your model - using the model debugger
This page was created by Lars.olofsson on 2017-03-06. Last edited by Edgar on 2025-10-12.
For background, see: Using the model debugger to change the model itself.
To find all ViewModels with a specific tag:
Span.allInstances->select(s | s.TaggedValue->select(tv | tv.Tag.toUpper='MVC')->notEmpty)
To add the tag MVC to all ViewModels that don't already have it:
Span.allInstances->select(s | s.TaggedValue->select(tv | tv.Tag.toUpper='MVC')->isEmpty)->forEach(s |
let newtag = TaggedValue.Create in
(
newtag.Tag := 'MVC';
newtag.Value := 'True';
newtag.ModelElement := s
)
)
To add the tag Eco.BusinessDeleteRule to all association ends that don't already have it, set it to NeedNotBeEmptyNoWarning:
AssociationEnd.allInstances->select(s | s.TaggedValue->select(tv | tv.Tag='Eco.BusinessDeleteRule')->isEmpty)->forEach(s |
let newtag = TaggedValue.Create in
(
newtag.Tag := 'Eco.BusinessDeleteRule';
newtag.Value := 'NeedNotBeEmptyNoWarning';
newtag.ModelElement := s
)
)
