dateEqual Function Description
Description
The dateEqual function compares two atomic values of type date and returns true if and only if the 2 arguments to the function are equal according to the equality rules defined by the date type.
dateEqual 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:date-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's birthday is April 1st 2001
*/
rule dateEqualExample{
target clause birthday=="2001-04-01":date
permit
}
In this example, the rule will return Permit if the user's birthday is on April 1st 2001. Note how types are translated in ALFA using the : (colon) notation.
Related Functions
Other functions in the equality predicates category: