So i have a sequence of Visualization Attribute called vizAttrs. This is what I actually want to do:
[for (va: VisualizationAttribute | dataBinding2.eContents(VisualizationAttribute))]
[vizAttrs = vizAttrs->excluding(va) /]
[/for]
If I check the element of vizAttrs after the loop, it will still contain the va that I expect to be excluded. But if I tried something like:
[for (va: VisualizationAttribute | dataBinding2.eContents(VisualizationAttribute))]
[let newVizAttrs:Sequence(VisualizationAttribute) = vizAttrs->excluding(va) /]
[/for]
When I check it, the newVizAttrs does have the expected value, which excludes that va element. But newVizAttrs couldn't be used for the next iteration of that for loop. I assumed it's probably because somehow vizAttrs is immutable. Is there any way to make vizAttrs, or Sequence/Collection, mutable in Acceleo?
I found that apparently all variables in Acceleo are finals. Source: https://stackoverflow.com/a/12003064/12466641
Seems like it is not possible to mutate
vizAttrsin my case. I will search for a workaround instead.