Dates Comparator

Note: You can use this component in a price plan, in a pricing macro, in a charging plan, or in a refill plan (refill logic).

The Dates Comparator component compares two date properties. Five comparison operators are available:

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:

When the component is executed, only one branch is activated depending on the test result.

Use

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:

  1. After you add the component, choose a date property, a reference date or define constraints.

  2. Describe the pricing of each decision tree branch by using a Function component.

Example

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.

Identification area

Name: Type the name of the component (mandatory).

Description: Allows you to type the description of the component (optional).

Definition tab

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:

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:

  • A date property with a reference date: You first select the date property and the reference date. You then use the set of constraints to select which part of the date property you want to compare with the reference date. For example, you select "agreement_creation_date" as the date property and "contract_date" as the reference date. The set of constraints allows you to select the different parts of the "agreement_creation_date" you compare with the "contract_date": Day of week (contract_date's one), Day of month (contract_date's one), Month (contract_date's one), and so on.

  • A date property with a set of defined constraints: You first select the date property, and you select "Choose a property" in the Reference Date box. You then define the constraints that you want to compare with the date property. For example, you select Day of week (Monday), Day of month (5), Month (January), and so on.

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: