Periods Data Model Buckets (3.1)

The UDRs in PCC.Periods contain information about different time periods used for products and their associated buckets.

If all the fields (except StartTime and StopTime) are left empty, the product, and its associated buckets, will be active the entire time between the StartTime and StopTime. Usage should only be counted in buckets connected to products that are active, and enforcements should only be checked and applied for products that are active.

Periods UDR

Field

Description

ID (int)

The unique ID of the period.

Name (string)

The name of the period.

StartTime (date)

Defines the start date and time for this period. This is the overall start time for the period and this field is mandatory for all periods.

StopTime (date)

Defines the end date and time for this period. This is the overall end time for the period and if it is left empty, the period will have no end.

StartTimeOfDay (date)

Defines the start time of the day in hours and minutes for the this period. The products using this period will start being active at this time of day. The format should be HH:MM.

StopTimeOfDay (date)

Defines the end time of the day in hours and minutes for this period. The products using this period will stop being active at this time of day. The format should be HH:MM.

Weekdays (list <int>)

Determines which weekdays the period should be active. The days are stated with integer values; 0 - Monday, 1 - Tuesday, 2 - Wednesday, 3 - Thursday, 4 - Friday, 5 - Saturday, and 6 - Sunday. Any combination is possible.

IncludedPeriods (list <Period (PCC.Periods)>)

Contains a list with other periods that should be included in this period. Since the list contains periods, they can in turn include or exclude other periods in their respective IncludedPeriods and ExcludedPeriods settings, which can be useful for creating a more complex inclusion setup.

ExcludedPeriods (list<Period (PCC.Periods)>)

Contains a list with other periods that should be excluded from this period. Since the list contains periods, they can in turn include or exclude other periods in their respective IncludedPeriods and ExcludedPeriods settings, which can be useful for creating a more complex exclusion setup.

Below is a screenshot of the UDR Assistance displaying the Periods UDR:

Periods UDR

Configuring a Period

A period configuration can consist of either a single period or a period including or excluding one or several other periods.

To configure a period:

  1. Configure each period with StartTime and StopTime and any included/excluded periods.

  2. For periods that are not supposed to be active 24 h a day, 365 days a year, configure the fields StartTimeOfDay , StopTimeOfDay , and Weekdays .

    If no Weekdays are defined, the period will be active every day of the week.

    If no StartTimeOfDay or StopTimeOfDay are defined, the period will be active all the time that the included periods are active.

  3. Add periods that you want to include and exclude for the period in the IncludedPeriods and ExcludedPeriods fields.

Note!

If a period includes other periods, that should all be active during the same hours/minutes and days, you only have to configure the StartTimeOfDay , StopTimeOfDay , and Weekdays fields in the top level period.

However, if the included periods should be active during different hours/minutes or days, the StartTimeOfDay , StopTimeOfDay , and Weekdays fields should be configured for each included period and not for the top level period.


Using the settings for including and excluding periods will create a tree structure with one period at the top with one or several periods included and excluded beneath. In order for a configured period to be active, all three of the following criteria must met:

  • The current time stamp must be within the set StartTime and StopTime of the top level period.

  • If any periods are included, the current time stamp must be within the set StartTimeOfDay and StopTimeOfDay of at least one included period.

  • If any periods are excluded, the current time stamp cannot be within the StartTimeOfDay or StopTimeOfDay of any of the excluded periods.

Example of a Period Configuration

In this example, we have a period including and excluding five other periods, configured as follows:

"Top Level" Period

StartTime

2012-01-01 08:00

StopTime

2015-12-31 08:00

Included periods

Weekdays, Weekends

Excluded periods

Midsummer

"Weekdays" Period

StartTime

2012-01-01 07:00

StopTime

2013-01-01 06:00

StartTimeOfDay

08:00

StopTimeOfDay

16:00

Weekdays

Monday(0), Tuesday(1), Wednesday(2), Thursday(3), Friday(4)

"Weekends" Period

StartTime

2012-01-01 07:00

StopTime

2013-01-01 06:00

StartTimeOfDay

08:00

StopTimeOfDay

16:00

Included periods

Ordinary, Christmas

"Midsummer" Period

StartTime

2012-06-22 12:00

StopTime

2012-06-23 00:00

StartTimeOfDay

12:00

StopTimeOfDay

16:00

Weekdays

Friday(4), Saturday(5)

"Christmas" Period

StartTime

2012-12-24 06:00

StopTime

2012-12-26 00:00

StartTimeOfDay

12:00

StopTimeOfDay

23:00

"Ordinary" Period

StartTime

2012-01-01 06:00

StopTime

2013-01-01 00:00

StartTimeOfDay

08:00

StopTimeOfDay

16:00

Weekdays

Saturday(5), Sunday(6)

Example configuration of Periods

If current date and time is 2012-06-08 10:00 (a Friday) the period will be active.

If current date and time is 2012-12-25 23:20 (a Tuesday)the period will not be active.