This topic lists the functions that can be used when writing rules in Oracle Policy Modeling.
Note that the list separator ',' may change depending on the region of the policy model.
Table 1 lists the logical connectors that can be used in Intelligent Advisor rules.
Table 2 lists the logical functions that can be used in Intelligent Advisor rules.
Table 3 lists the logical constants that can be used in Intelligent Advisor rules.
Table 4 lists the comparison operators that can be used in Intelligent Advisor rules.
Table 5 lists the numerical functions that can be used in Intelligent Advisor rules.
Table 6 lists the date functions that can be used in Intelligent Advisor rules.
Table 6. Date functions
CurrentDate()
the current date
|
Returns the current date at the start of the session.
|
Date(<text>)
|
Converts the specified string into a date value
|
MakeDate(<year>,<month>,<day>)
|
Returns a date formed from the specified year, month, and day.
|
ExtractDay(<date or datetime>)
|
Returns the day component of a date/datetime attribute.
|
ExtractMonth(<date or datetime>)
|
Returns the month component of a date/datetime attribute.
|
ExtractYear(<date or datetime>)
|
Returns the year component of a date/datetime attribute.
|
NextDayOfTheWeek(<date or datetime>,<day of week>)
the next Monday on or after <date or datetime> the Monday on or before <date or datetime> the next Tuesday on or after <date or datetime> the Tuesday on or before <date or datetime> the next Wednesday on or after <date or datetime> the Wednesday on or before <date or datetime> the next Thursday on or after <date or datetime> the Thursday on or before <date or datetime> the next Friday on or after <date or datetime> the Friday on or before <date or datetime> the next Saturday on or after <date or datetime> the Saturday on or before <date or datetime> the next Sunday on or after <date or datetime> the Sunday on or before <date or datetime>
|
Returns the date of the next weekday on or before/after a date (depending on the syntax used).
|
NextDate(<date>,<day of month>,<month>)
|
Returns the next instance of the given day and month after a date.
|
AddDays(<date or datetime>,<number of days>)
the (date | time)<number-of-days>(days | day) after <datetime> the (date | time)<number-of-days>(days | day) before <datetime>
|
Adds/subtracts a number of days to a date. When using the terse syntactic form, the number must be a positive integer in order to add days to the input date, or a negative number in order to subtract days from the input date.
|
AddWeeks(<date or datetime>,<number of weeks>)
the (date | time)<number-of-weeks>(weeks | week) after <datetime> the (date | time)<number-of-weeks>(weeks | week) before <datetime>
|
Adds a number of weeks to a date. When using the terse syntactic form, the number must be a positive integer in order to add weeks to the input date.
|
AddMonths(<date or datetime>,<number of months>)
the (date | time)<number-of-months>(months | month) after <datetime> the (date | time)<number-of-months>(months | month) before <datetime>
|
Adds a number of months to a date. When using the terse syntactic form, the number must be a positive integer in order to add months to the input date.
|
AddYears(<date or datetime>,<number of years>)
the (date | time)<number-of-years>(years | year) after <datetime> the (date | time)<number-of-years>(years | year) before <datetime>
|
Adds a number of years to a date. When using the terse syntactic form, the number must be a positive integer in order to add years to the input date.
|
WeekdayCount(<date>,<date>)
the number of weekdays (inclusive) between <date1> and <date2>
|
Counts the number of weekdays between date1 and date2. That is, the number of days falling between Monday and Friday. Note: The earlier date is inclusive and the later date is exclusive.
|
YearStart(<date or datetime>)
the first day of the year in which <date or datetime> falls
|
Returns the first date in the year in which a date falls.
|
YearEnd(<date or datetime>)
the last day of the year in which <date or datetime> falls
|
Returns the last date in the year in which a date falls.
|
DayDifference(<date or datetime>,<date or datetime>)
the number of days from <date1> to <date2>
|
Returns the number of whole days between date/datetime1 and date/datetime2. The order of the two dates does not affect the result.
|
DayDifferenceInclusive(<date>,<date>)
the number of days (inclusive) from <date1> to <date2>
|
Returns the number of whole days (inclusive) between date1 and date2. This calculation includes both endpoints. Where the dates are the same, the result is 1. The order of the two dates does not affect the result.
|
DayDifferenceExclusive(<date>,<date>)
the number of days (exclusive) from <date1> to <date2>
|
Returns the number of whole days (exclusive) between date1 and date2. This calculation excludes both endpoints. Where the dates are the same, the result is 0. The order of the two dates does not affect the result.
|
WeekDifference(<date or datetime>,<date or datetime>)
the number of weeks from <date1> to <date2>
|
Returns the number of whole elapsed weeks between date/datetime1 and date/datetime2. The order of the two dates does not affect the result.
|
MonthDifference(<date or datetime>,<date or datetime>)
the number of months from <date1> to <date2>
|
Returns the number of whole elapsed months between date/datetime1 and date/datetime2. The order of the two dates does not affect the result.
|
YearDifference(<date or datetime>,<date or datetime>)
the number of whole years which <date2> is after <date1> the number of years between <date1> and <date2>
|
Returns the number of years between date/datetime1 and date/datetime2. The order of the two dates does not affect the result.
|
Table 7 lists the time of day functions that can be used in Intelligent Advisor rules.
Table 8 lists the date and time functions that can be used in Intelligent Advisor rules.
Table 8. Date and time functions
CurrentDateTime()
the current date time
|
Returns the current date and time at the start of the session.
|
DateTime(<text>)
|
Converts the specified string into a datetime value
|
ConcatenateDateTime(<date>,<time>)
|
Sets the date time by joining the date and time of day together.
|
SecondDifference(<datetime1>,<datetime2>)
the number of seconds from <datetime1> to <datetime2>
|
Returns the number of seconds between datetime1 and datetime2.
|
SecondDifferenceInclusive(<datetime1>,<datetime2>)
the number of seconds (inclusive) from <datetime1> to <datetime2>
|
Returns the inclusive number of seconds between datetime1 and datetime2.
|
SecondDifferenceExclusive(<datetime1>,<datetime2>)
the number of seconds (exclusive) from <datetime1> to <datetime2>
|
Returns the exclusive number of seconds between datetime1 and datetime2.
|
MinuteDifference(<datetime1>,<datetime2>)
the number of minutes from <datetime1> to <datetime2>
|
Returns the number of minutes between datetime1 and datetime2.
|
HourDifference(<datetime1>,<datetime2>)
the number of hours from <datetime1> to <datetime2>
|
Returns the number of hours between datetime1 and datetime2.
|
ExtractDate(<datetime>)
|
Extracts the date from a datetime attribute.
|
ExtractTimeOfDay(<datetime>)
|
Extracts the time of day from a datetime attribute. Can be used to set the value of a timeofday attribute to the time the rule is executed by extracting the time from the current date and time.
|
AddHours(<datetime>,<number of hours>)
the time <number-of-hours>(hours | hour) after <datetime> the time <number-of-hours>(hours | hour) before <datetime>
|
Adds a number of hours to a date time.
|
AddMinutes(<datetime>,<number of minutes>)
the time <number-of-minutes>(minutes | minute) after <datetime> the time <number-of-minutes>(minutes | minute) before <datetime>
|
Adds a number of minutes to a date time.
|
AddSeconds(<datetime>,<number of seconds>)
the time <number-of-seconds>(seconds | second) after <datetime> the time <number-of-seconds>(seconds | second) before <datetime>
|
Adds a number of seconds to a date time.
|
Table 9 lists the text functions that can be used in Intelligent Advisor rules.
Table 10 lists the entity and relationship functions that can be used in Intelligent Advisor rules.
Table 10. Entity and relationship functions
For(<relationship>,<value>)
in the case of <relationship>, <condition> <value>, in the case of <relationship>
|
Used to refer from one entity to another entity in a "One To One", "Many To One" or "Many To Many" relationship where there is only one condition.
|
ForScope(<relationship>,<alias>)
ForScope(<relationship>)
in the case of <relationship> in the case of <relationship> (<alias>)
|
Used to refer from one entity to another entity in a "One To One", "Many To One" or "Many To Many" relationship where there are one or more conditions. This function is not supported in Microsoft Excel rules.
|
ForAll(<relationship>,<condition>)
for each of <relationship>, <condition> for all of <relationship>, <condition>
|
Used to refer from one entity to another entity in a relationship, when you need to determine whether all members of the target entity group need to satisfy the rule. This form is used when there is only one condition in the rule.
|
ForAllScope(<relationship>)
ForAllScope(<relationship>,<alias>)
for all of <relationship> each of <relationship> for each of <relationship> for all of <relationship> (<alias>) each of <relationship> (<alias>) for each of <relationship> (<alias>)
|
Used to refer from one entity to another entity in a relationship, when you need to determine whether all members of the target entity group need to satisfy the rule. This form is used when there are one or more conditions in the rule. This function is not supported in Microsoft Excel rules.
|
Exists(<relationship>,<condition>)
for at least one of <relationship>, <condition>
|
Used to refer from one entity to another entity in a relationship, when you need to determine whether any members of the target entity group need to satisfy the rule. This form is used when there is only one condition in the rule.
|
ExistsScope(<relationship>)
ExistsScope(<relationship>,<alias>)
at least one of <relationship> for at least one of <relationship> at least one of <relationship> (<alias>) for at least one of <relationship> (<alias>)
|
Used to refer from one entity to another entity in a relationship, when you need to determine whether any members of the target entity group need to satisfy the rule. This form is used when there are one or more conditions in the rule. This function is not supported in Microsoft Excel rules.
|
IsMemberOf(<target>,<relationship>)
IsMemberOf(<target>,<alias>,<relationship>)
<target> is a member of <relationship> <target> (<alias>) is a member of <relationship> <target> is not a member of <relationship>
|
Used as a conclusion to infer that an entity instance is a member of a relationship. Used as a condition to test that an entity instance is a target of a relationship for which a second entity instance is the source. The negative form of this function is only supported as a condition, not as a conclusion. This function is not supported in Microsoft Excel rules.
|
InstanceCount(<relationship>)
the number of <relationship>
|
Counts the number of instances that exist for an entity.
|
InstanceCountIf(<relationship>,<condition>)
the number of <relationship> for which it is the case that <condition>
|
Counts the number of instances there are of an entity for which a particular entity-level attribute has a particular value.
|
InstanceMaximum(<relationship>,<attribute>)
<date-attribute> which is the latest for all [of]<relationship> <attribute> which is the greatest for all [of]<relationship> the latest of all <attribute> for <relationship> the greatest of <attribute> for
(all of | all | )<relationship>
|
Obtains the highest/most recent value of an entity-level variable for all instances of the entity.
|
InstanceMaximumIf(<relationship>,<attribute>,<condition>)
<date-attribute> which is the latest for all [of]<relationship>
for which it is the case that
<condition> <attribute> which is the greatest for all [of]<relationship>
for which it is the case that
<condition> the greatest of <attribute> for
(all of | all | )<relationship>
for which it is the case that
<condition>
|
Obtains the highest/most recent value of an entity-level variable for all instances of the entity for which a particular entity-level attribute has a particular value.
|
InstanceMinimum(<relationship>,<attribute>)
<date-attribute> which is the earliest for all [of]<relationship> <attribute> which is the least for all [of]<relationship> the earliest of all <attribute> for <relationship> the least of [all]<attribute> for [all][of]<relationship>
|
Obtains the lowest/least recent value of an entity-level variable for all instances of the entity.
|
InstanceMinimumIf(<relationship>,<attribute>,<condition>)
<date-attribute> which is the earliest for all [of]<relationship>
for which it is the case that
<condition> <number-attribute> which is the least for all [of]<relationship>
for which it is the case that
<condition> the least of all <attribute> for <relationship>
for which it is the case that
<condition> the earliest of all <attribute> for <relationship>
for which it is the case that
<condition>
|
Obtains the lowest/least recent value of an entity-level variable for all instances of the entity for which a particular entity-level attribute has a particular value.
|
InstanceSum(<relationship>,<number>)
<number-attribute>(totaled | totalled) for all [of]<relationship>
|
Obtains the sum of all instances of an entity-level variable.
|
InstanceSumIf(<relationship>,<number>,<condition>)
<number-attribute>(totaled | totalled) for all [of]<relationship>
for which it is the case that <condition>
|
Obtains the sum of all instances of an entity-level variable for which it is true of the entity that a specific entity-level Boolean attribute is true.
|
InstanceValueIf(<relationship>,<value>,<condition>)
|
Obtains a value from a unique entity instance, identified from the target entity instances of a relationship by a condition.- If the condition identifies a single target entity instance, then the value is the value calculated against that entity instance.
- If more than one target instance meets the condition, then Uncertain is returned.
- If no target instances meet the condition and the relationship is known the value is Uncertain.
|
InstanceEquals(<instance1>,<instance2>)
<instance1> is <instance2>
|
Determines if two instances of an entity are the same instance. This function is not supported in Microsoft Excel rules.
|
InstanceNotEquals(<instance1>,<instance2>)
<instance1> is not <instance2>
|
Determines if two instances of an entity are not the same instance. This function is not supported in Microsoft Excel rules.
|
InferInstance(<relationship>,<identity>)
<relationship>(<identity>) exists
|
Used as a conclusion to infer that an entity instance exists and is a member of a relationship.
|
InferInstanceFor(<entity>,<relationship>)
InferInstanceFor(<entity>,<alias>,<relationship>)
<inferred-entity> exists for <associated-relationship> <inferred-entity> exists for <associated-relationship> (<alias>)
|
Used as a conclusion to create an entity instance as a counterpart to an existing entity instance.
|
Table 11 lists the temporal reasoning functions that can be used in Intelligent Advisor rules.
Table 11. Temporal reasoning functions
IntervalCountDistinct(<start date>,<end date>,<value>)
|
Counts the number of known distinct values for the variable, in the interval from the start date (inclusive) to the end date (exclusive).
|
IntervalCountDistinctIf(<start date>,<end date>,<value>,<condition>)
|
Counts the number of known distinct values for the variable, in the interval from the start date (inclusive) to the end date (exclusive), only including times when a Boolean filter is true.
|
IntervalDailySum(<start date>,<end date>,<number>)
|
Calculates the sum of a currency or number variable, in the interval from the start date (inclusive) to end date (exclusive). The attribute is assumed to be a daily quantity.
|
IntervalDailySumIf(<start date>,<end date>,<number>,<condition>)
|
Calculates the sum of all the daily values for a currency or number variable, in the interval from a start date (inclusive) to an end date (exclusive), only including times when a condition is true.
|
IntervalMaximum(<start date>,<end date>,<attribute>)
|
Selects the maximum value of a variable in the interval from a start date (inclusive) to an end date (exclusive).
|
IntervalMaximumIf(<start date>,<end date>,<value>,<condition>)
|
Selects the maximum value of a variable in the interval from a start date (inclusive) to an end date (exclusive), only including times when a condition is true.
|
IntervalMinimum(<start date>,<end date>,<value>)
|
Selects the minimum value of a variable in the interval from a start date (inclusive) to an end date (exclusive).
|
IntervalMinimumIf(<start date>,<end date>,<attribute>,<condition>)
|
Selects the minimum value of a variable in the interval from a start date (inclusive) to an end date (exclusive), only including times when a condition is true.
|
IntervalWeightedAverage(<start date>,<end date>,<number>)
|
Calculates the average value of a currency or number variable in the interval from a start date (inclusive) to an end date (exclusive) weighted by the time span to which each value applies.
|
IntervalWeightedAverageIf(<start date>,<end date>,<number>,<condition>)
|
Calculates the average value of a currency or number variable in the interval from a start date (inclusive) to an end date (exclusive), only including times when a Boolean condition is true (weighted by the time span to which each value applies and where the filter is true).
|
IntervalAlways(<start date>,<end date>,<condition>)
|
Returns true if and only if a Boolean condition is true at all times in the interval from the start date (inclusive) to the end date (exclusive).
|
IntervalAtLeastDays(<start date>,<end date>,<number of days>,<condition>)
|
Returns true if and only if a Boolean condition is true for at least the specified number of days (not necessarily consecutive) in the interval from the start date (inclusive) to the end date (exclusive).
|
IntervalConsecutiveDays(<start date>,<end date>,<number of days>,<condition>)
|
Returns true if and only if a Boolean condition is true for at least a given number of consecutive days in the interval from the start date (inclusive) to the end date (exclusive).
|
IntervalSometimes(<start date>,<end date>,<condition>)
|
Returns true if and only if a Boolean condition is ever true in the interval from the start date (inclusive) to the end date (exclusive).
|
ValueAt(<date>,<value>)
|
Returns the value of the given attribute at the specified date.
|
WhenLast(<date>,<condition>)
|
Returns the date on which a Boolean condition was last true, looking backwards from (and including) a specified date.
|
WhenNext(<date>,<condition>)
|
Returns the date on which a Boolean condition will next be true, looking forwards from (and including) a specified date.
|
Latest()
|
Returns a date value equivalent to the latest possible date - namely a date guaranteed to be later than any other date that a date attribute may take or an expression may evaluate to.
|
Earliest()
|
Returns a date value equivalent to the earliest possible date - namely a date guaranteed to be earlier than any other date that a date attribute may take or an expression may evaluate to.
|
TemporalDaysSince(<start date>,<end date>)
|
Returns a number variable that varies every day and is the number of full days since the date.
|
TemporalWeeksSince(<start date>,<end date>)
|
Returns a number variable that varies every week and is the number of full weeks since the date.
|
TemporalMonthsSince(<start date>,<end date>)
|
Returns a number variable that varies every month and is the number of full months since the date. Note: Where the supplied date is after the 28th day of the month, and a subsequent month has fewer days than the supplied month, the change point for the anniversary month will be created on the last day of that month. For example, if the supplied date is 28, 29, 30 or 31 January 2007, the first change point will be 28 February 2007.
|
TemporalYearsSince(<start date>,<end date>)
|
Returns a number variable that varies every year and is the number of full years since the date.
|
TemporalAlwaysDays(<days>,<condition>)
|
Returns a Boolean attribute that varies over time and is true if and only if a Boolean condition is true for all of a given number of preceding days, not including the current day.
|
TemporalConsecutiveDays(<required days>,<search days>,<condition>)
|
Returns a Boolean attribute that varies over time and is true if and only if a Boolean condition is true for at least a minimum number of consecutive days at any time within the preceding set number of days, not including the current day.
|
TemporalSometimesDays(<days>,<condition>)
|
Returns a Boolean attribute that varies over time and is true if and only if a Boolean condition is ever true within a specified number of preceding days, not including the current day.
|
TemporalAfter(<date>)
|
Returns a Boolean attribute that varies over time and is true after a date and false on and before.
|
TemporalBefore(<date>)
|
Returns a Boolean attribute that varies over time and is true before a date and false on and afterwards.
|
TemporalOn(<date>)
|
Returns a Boolean attribute that varies over time and is true on a date and false before and afterwards.
|
TemporalOnOrAfter(<date>)
|
Returns a Boolean attribute that varies over time and is true on or after a date and false before.
|
TemporalOnOrBefore(<date>)
|
Returns a Boolean attribute that varies over time and is true on and before a date and false afterwards.
|
TemporalFromStartDate(<relationship>,<date>,<value>)
|
Returns a single temporal attribute (at the source entity level) from a relationship and a value attribute on the entities, with values that take effect from a start date attribute.
|
TemporalFromEndDate(<relationship>,<date>,<value>)
|
Returns a single temporal attribute (at the source entity level) from a relationship and a value attribute on the entities, with values that take effect up until an end date attribute.
|
TemporalFromRange(<relationship>,<start date>,<end date>,<value>)
|
Returns a single temporal attribute (at the source entity level) from a relationship and a value attribute on the entities, with values that takes effect from a start date attribute (inclusive) until and end date attribute (exclusive). The value is uncertain if it expires before the next start date.
|
TemporalIsWeekday(<start date>,<end date>)
|
Returns true on dates that are weekdays and false on dates that are weekends from the specified start date (inclusive) to the end date (exclusive). Returns uncertain outside of the date range.
|
TemporalOncePerMonth(<start date>,<end date>,<day of month>)
|
Returns true if the day is equal to the day-of-month parameter and false on all other days of the month from the specified start date (inclusive) to the end date (exclusive). Returns uncertain outside of the date range. When the day-of-month exceeds the number of days in the current month, the value is true on the last day of that month, so that the function returns a value that is true exactly one day per month.
|
Table 12 lists the validation event functions that can be used in Intelligent Advisor rules.
Table 13 lists other functions that can be used in Intelligent Advisor rules.