Collection of strings
(Automatically adding template at the end of the page.) |
(Adding message template to the top of the page) |
||
Line 1: | Line 1: | ||
{{message|Write the content here to display this box}} | |||
To create a collection of strings in an OCL or EAL expression, use [[OCLOperators Sequence]] or [[OCLOperators Set]]. | To create a collection of strings in an OCL or EAL expression, use [[OCLOperators Sequence]] or [[OCLOperators Set]]. | ||
Revision as of 22:13, 16 June 2024
This page was created by Lars.olofsson on 2022-04-16. Last edited by Stephanie on 2025-02-07.
Write the content here to display this box
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.