Compares a left-hand-side value with a right-hand-side value, according to the comparison provided.
The comparisons supported are:
left hand side "is less than" right hand side;
left hand side "is less than or equal to" right hand side;
left hand side "is greater than" right hand side; and
left hand side "is greater than or equal to" right hand side.
The left hand side and right hand side values can be of any type of comparable object, including (but not limited to):
<?xml version="1.0" encoding="UTF-8"?> <RuleSet name="Example_compare" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "http://www.curamsoftware.com/CreoleRulesSchema.xsd"> <Class name="CompareExampleRuleClass"> <!-- 3 >= 2 - TRUE--> <Attribute name="compareTwoNumbers"> <type> <javaclass name="Boolean"/> </type> <derivation> <compare comparison=">="> <Number value="3"/> <Number value="2"/> </compare> </derivation> </Attribute> <!-- New Year earlier than Christmas - TRUE --> <Attribute name="compareTwoDates"> <type> <javaclass name="Boolean"/> </type> <derivation> <compare comparison="<"> <Date value="2007-01-01"/> <Date value="2007-12-25"/> </compare> </derivation> </Attribute> </Class> </RuleSet>