Duration Adapter Operator

The Duration Adapter Operator component converts a period of time into another time unit. The calculation result is saved in a new numerical property. You can convert into days a numerical property expressed in seconds or in hours. You can specify the time unit of the source and the target, the rounding mode, the rounding step, and the threshold of the target.

Use

In a price plan, you may need to make calculations dependent of time and that you want to convert into a different time unit. To do that, you use the Duration Adapter component to convert a period of time. The conversion result is saved in a new numerical property.

Example

In a chargeable item class called “Telephone Service”, a phone call duration is expressed in seconds. You need to convert the call duration into minutes because your price is defined in minutes. You use the Duration Adapter Operator to convert the call duration into minutes.

Identification area

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

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

Definition tab

You define the names and the time unit of the source, the new numerical property that retrieves the conversion result, and the time unit for converting the source.

Source Duration Name: Provides the list of numerical properties. Select a numerical property.

Source Time Unit: Provides the list of time units of the source. Select one of the following time units:

Target Duration Name: Allows you to type the name of the new property that retrieves the conversion result.

Target Time Unit: Provides the list of time units for converting the source. Select one of the following time units:

Calculation Parameters tab

You set up the calculation parameters to convert the conversion result.

Rounding Unit: Provides the list of time units for rounding the conversion result. The default option is seconds. Select one of the following time units:

Rounding Mode: Provides the list of modes for rounding the conversion result. The default option is To the next greater value. Select one of the following rounding modes:

Rounding Step: Allows you to type a step rule to round the conversion result, or allows you to select a numerical property that represents the step rule. The default option is 1. Example: If the rounding step value is 5 seconds and the rounding mode is To the next greater value, a conversion result of 47 seconds is rounded to 50 seconds. In this example, the rounding step then consists of 5-second intervals.

Threshold: Allows you to type the minimum value of the conversion result, or allows you to select a numerical property that represents the minimum value. The default option is 0. Example: If the threshold is 30 seconds, a duration less than 30 seconds is rounded to 30 seconds.