For all
- Last Updated: August 13, 2020
- 2 minute read
- Corticon
- Documentation
SYNTAX
<Collection>
->forAll(<Expression1>,
<Expression2>,…)
<Collection>
->forAll(<Expression1> or
<Expression2> or
…)
<Expression> holds true for
every element of
<Collection>. <Collection> must be
expressed as a unique alias. Multiple <Expressions> are
optional, but at least one is required. Both AND (indicated by commas between
<Expressions>) and OR syntax (indicated by
or between <Expressions>) is supported
within the parentheses (..). However, take care to ensure invariant
expressions are not inadvertently created. For
example:
<Collection> -> forAll(integer1=5, integer1=8)will always evaluate to false
because no single integer1 value can be both 5
AND
8 simultaneously, let alone all of them.
USAGE RESTRICTIONS
The Operators row of the table in Summary Table of Vocabulary Usage Restriction applies. No special exceptions.
This sample Rulesheet uses ->forAll to check for the existence of an element incollection1 whose string1 value equals New, and assigns a
value to decimal1 based on the results of the
test. Note the use of unique alias collection1 to
represent the collection of Entity2 associated with
Entity1.![]()
Entity2 elements and Entity1.decimal1 values. The following illustration shows Input and Output
panel![]()