임의의 목록 값이 true인지를 판별하기 위해 부울 값 목록에 대해 작동합니다.
목록에서 첫 번째 true 값이 발견되면 계산이 중지됩니다. 목록이 비어 있으면 이 표현식이 false를 리턴합니다.
일반적으로 fixedlist 또는 dynamiclist에 부울 값 목록이 제공됩니다.
예를 들어, 세 개의 부울 속성이 있는 고정 목록에 다음과 같은 값이 있습니다.
그러면 두 번째 항목이 오류를 리턴해도 항목 중 하나 이상이 true(즉, 목록의 세 번째)이므로 이러한 값에 대한 any 값을 계산하면 true가 리턴됩니다.
반대로 세 개의 부울 속성이 있는 다른 고정 목록에 다음과 같은 세 개의 값이 있습니다.
그러면 목록의 두 번째 항목이 보고한 오류로 인해 값이 true인 항목이 있는지가 판별되지 않으므로 이러한 값에 대한 any 값을 계산하면 두 번째 항목이 보고한 이 오류가 리턴됩니다.
<?xml version="1.0" encoding="UTF-8"?> <RuleSet name="Example_any" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "http://www.curamsoftware.com/CreoleRulesSchema.xsd"> <Class name="Person"> <Attribute name="qualifiesForFreeTravelPass"> <type> <javaclass name="Boolean"/> </type> <derivation> <!-- <fixedlist>에서 작동하는 <any>의 예 --> <!-- 무료 여행 탑승권을 받을 자격이 되려면 개인이 고령자이거나 시각 장애 또는 신체 장애가 있어야 합니다. --> <any> <fixedlist> <listof> <javaclass name="Boolean"/> </listof> <members> <!-- 데이터베이스에 있는 대부분의 사람들이 고령자임을 알게 되었으므로 이 조건을 먼저 테스트합니다. 개인에 대해 isBlind 값이 지정되지 않으면 이 개인에게 신체 장애가 있는 경우 <any>가 false를 리턴합니다. 그렇지 않으면 isBlind의 값이 지정되지 않았음을 표시하는 오류가 리턴됩니다. --> <compare comparison=">="> <reference attribute="age"/> <Number value="65"/> </compare> <reference attribute="isBlind"/> <reference attribute="isDisabled"/> </members> </fixedlist> </any> </derivation> </Attribute> <Attribute name="qualifiesForChildBenefit"> <type> <javaclass name="Boolean"/> </type> <derivation> <!-- <dynamiclist>에서 작동하는 <any>의 예입니다. 한 아동의 나이를 계산할 수 없는 경우가 발생하고 16세 미만의 아동이 한 명 이상인 경우 <any>가 true를 리턴합니다. 그렇지 않으면 오류가 리턴되어 아동의 나이를 계산할 수 없는 이유가 표시됩니다. --> <!-- 자녀 보조금을 받을 자격이 되려면 이 개인에게 16세 미만의 자녀가 한 명 이상 있어야 합니다. --> <any> <dynamiclist> <list> <reference attribute="children"/> </list> <listitemexpression> <compare comparison="<"> <reference attribute="age"> <current/> </reference> <Number value="16"/> </compare> </listitemexpression> </dynamiclist> </any> </derivation> </Attribute> <!-- 이 개인의 자녀 - 각 자녀도 개인입니다. --> <Attribute name="children"> <type> <javaclass name="List"> <ruleclass name="Person"/> </javaclass> </type> <derivation> <specified/> </derivation> </Attribute> <Attribute name="isBlind"> <type> <javaclass name="Boolean"/> </type> <derivation> <specified/> </derivation> </Attribute> <Attribute name="isDisabled"> <type> <javaclass name="Boolean"/> </type> <derivation> <specified/> </derivation> </Attribute> <Attribute name="age"> <type> <javaclass name="Number"/> </type> <derivation> <specified/> </derivation> </Attribute> </Class> </RuleSet>