<Collection> ->exists(<Expression1> or <Expression2> or …)
DESCRIPTION
Returns a value of true if <Expression> holds true for at least one 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>) are supported within the parentheses (..). However, take care to ensure invariant expressions are not inadvertently created. For example:
<Collection> -> exists(integer1=5, integer1=8)
will always evaluate to false because no integer1 value can be both 5AND8 simultaneously.
This sample Rulesheet uses ->exists to check for the existence of an element in collection1 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.
SAMPLE RULETEST
A sample Ruletest provides 2 separate collections of Entity2 elements and Entity1.decimal1 values. Input and Output panels are shown below.