The Dates Comparator component compares two date properties. Five comparison operators are available:
Has the same
Is equal to
Is after
Is strictly after
Is before
Is strictly before
The comparison is true when a date property matches a reference date or defined constraints.
When you insert it in the decision tree, the Dates Comparator component creates two separate branches:
A branch that is activated when the comparison is true
A branch that is activated when the comparison is false
When the component is executed, only one branch is activated depending on the test result.
In a price plan, if you want to apply different prices to branches, you may need to compare a date property with a reference date. To use the Dates Comparator component in the price plan, do the following:
After you add the component, choose a date property, a reference date or define constraints.
Describe the pricing of each decision tree branch by using a Function component.
In the context of a special "end of the year" promotional offer, a telephone operator wants to charge a special price ($0.15 per minute) for all the calls that begin on Sundays during the month of December. All the other calls are rated at the regular price. The following table presents the information that the telephone operator needs to set up the Dates Comparator component inside the price plan:
|
Data |
Settings |
|
Property |
“Call start date” |
|
First constraint |
Select “Sunday” as the “Day of week” |
|
Second constraint |
Select “December” as the “Month” |
|
Pricing rules |
Price that is applied to the “is” branch: $0.15 per minute. Price that is applied to the “is not” branch: usual price. |
Name: Type the name of the component (mandatory).
Description: Allows you to type the description of the component (optional).
Property Name: Provides the list of date properties. Select the first date property.
Operator: Provides the list of operators. The operator "Has the same" is used with the option Set the Constraints to Apply to This Date. The other operators are used only to compare the first date property with a reference date. Select one of the following operators:
Has the same
Is equal to
Is after
Is strictly after
Is before
Is strictly before
Reference Date: Provides the list of date properties. Select the reference date that you want to compare with the first date property.
|
Important: The option Set the Constraints to Apply to This Date allows you to compare:
|
Set the Constraints to Apply to This Date: Allows you to set up the constraints on the date property. This option is available only if you have selected "Has the same" in the Operator list. You can select one or more criteria:
Day of week: Allows you to compare the day of the date property with any day of the week or with the day of the reference date. Click this option, and then select the day in the list.
Day of month: Allows you to compare the day of the date property with any day of the month or with the day of the month of the reference date. Click this option, and then select the day of month in the list.
Month: Allows you to compare the month of the date property with any month or with the month of the reference date. Click this option, and then select the month in the list.
Year: Allows you to compare the year of the date property with any year or with the year of the reference date. Click this option, and then select the year in the list.