Collection of strings
m ((username removed) (log details removed): Moving to Documentation namespace)
(Automatically adding template at the end of the page.)
Line 10: Line 10:
[[Category:OCL]]
[[Category:OCL]]
[[Category:EAL]]
[[Category:EAL]]
{{Edited|July|12|2024}}

Revision as of 15:28, 10 February 2024

This page was created by Lars.olofsson@mdriven.net on 2022-04-16. Last edited by Stephanie@mdriven.net on 2025-02-07.

To create a collection of strings in an OCL or EAL expression, use OCLOperators Sequence or OCLOperators Set.

You can have the declaration based on an expression, like this:

Sequence{
  self.ValidMaterials->notEmpty.caseTrueFalse('Materials', String.nullValue),
  self.ValidColors->notEmpty.caseTrueFalse('Colors', String.nullValue),
  self.ValidFinish->notEmpty.caseTrueFalse('Finish', String.nullValue)
}->asCommaList

The example above will create a comma-separated list of strings with a dynamic length/size depending on the expressions.