Collection of strings
(Created page with "To create a collection of strings in a OCL or EAL expression, use OCLOperators Sequence or OCLOperators Set. You can have the declaration based on a expression, like...")
 
(Automatically adding template at the end of the page.)
 
(3 intermediate revisions by 2 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]].
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 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 7:
   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:EAL]]
{{Edited|July|12|2024}}

Latest revision as of 15:28, 10 February 2024

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.

This page was edited 98 days ago on 02/10/2024. What links here