booleanEqual Function Description
Description
The booleanEqual function compares two atomic values of type boolean and returns true if and only if the 2 arguments to the function are equal according to the equality rules defined by the boolean type.
booleanEqual belongs to the ALFA function reference's
equality predicates category. It maps to the XACML function identifier
urn:oasis:names:tc:xacml:1.0:function:boolean-equal, takes 2 arguments and returns a value of type boolean.
| Property | Value |
|---|---|
| Category | equality predicates |
| # Arguments | 2 |
| Arguments |
|
| Return Value | boolean |
| Expressed As | in-fix |
| Representation | a == b |
| Allowed In Target | true |
| ALFA Shorthand | == |
| Commutative | true |
Example
/**
* This rule will return Permit if the user is marked as active and their age is over 18
*/
rule booleanEqualExample{
target clause isActive==true and isOver18==true
permit
}
In this example, we use the booleanEqual function in the target. The rule will return Permit if both isActive and isOver18 evaluate to true.
Related Functions
Other functions in the equality predicates category: