Collection of strings
No edit summary
No edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
To create a collection of strings in a OCL or EAL expression, use [[OCLOperators Sequence]] or [[OCLOperators Set]].
<message>Write the content here to display this box</message>
To create a collection of strings in an OCL or EAL expression, use [[Documentation:OCLOperators Sequence|OCLOperators Sequence]] or [[Documentation:OCLOperators Set|OCLOperators Set]].


You can have the declaration based on a expression, like this
You can have the declaration based on an expression, like this:
  Sequence{
  Sequence{
   self.ValidMaterials->notEmpty.caseTrueFalse('Materials', String.nullValue),
   self.ValidMaterials->notEmpty.caseTrueFalse('Materials', String.nullValue),
Line 7: Line 8:
   self.ValidFinish->notEmpty.caseTrueFalse('Finish', String.nullValue)
   self.ValidFinish->notEmpty.caseTrueFalse('Finish', String.nullValue)
  }->asCommaList
  }->asCommaList
The example above will create a comma separated list of strings with a dynamic length/size depending on the expressions.
The example above will create a comma-separated list of strings with a dynamic length/size depending on the expressions.
[[Category:OCL]]
[[Category:OCL]]
[[Category:EAL]]
[[Category:EAL]]
{{Edited|July|12|2025}}

Latest revision as of 05:06, 7 February 2025

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.