Adding or removing tagged values in your model - using the model debugger
(Created page with "For background, see Using the model debugger to change the model itself ==== To find all viewmodels with a specific tag ==== <code>Span.allInstances->select(s | s.TaggedV...")
 
No edit summary
Line 5: Line 5:


==== To add the tag MVC to all viewmodels that don't already have it ====
==== To add the tag MVC to all viewmodels that don't already have it ====
<code>Span.allInstances->select(s | s.TaggedValue->select(tv | tv.Tag.toUpper='MVC')->isEmpty)->collect(s |</code>


<code>let newtag = TaggedValue.Create in</code>
Span.allInstances->select(s | s.TaggedValue->select(tv | tv.Tag.toUpper='MVC')->isEmpty)->collect(s |
 
let newtag = TaggedValue.Create in
<code>(</code>
(
 
    newtag.Tag := 'MVC';
<code>newtag.Tag := 'MVC';</code>
    newtag.Value := 'True';
 
    newtag.ModelElement := s
<code>newtag.Value := 'True';</code>
  )
 
)
<code>newtag.ModelElement := s</code>
 
<code>)</code>
 
<code>)</code>

Revision as of 13:14, 6 March 2017

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)->collect(s |
let newtag = TaggedValue.Create in
(
    newtag.Tag := 'MVC';
    newtag.Value := 'True';
    newtag.ModelElement := s
  )
)
This page was edited 80 days ago on 02/10/2024. What links here