'get_capacity' Logics Example

If no statistical data for the company is available, the default duration for the processed activity type with label 'AL' is returned as defined in the 'default_duration' parameter, and 'activity_travel_time' value is returned as defined in Manage Application → Company Settings → Statistics Parameters → Statistics parameters/Default travel average time.

Also 'activity_duration' for the activity type with label 'AL' is returned as 60 minutes according to the value of the 'default_duration' parameter sent in the request.

For 4 February 2014 capacity data is returned only for time slot from 12 to 5 p.m., because the time left from now (2014-04-04 10:00AM) till the end of the current time slot (from 08 to 12 a.m.) is less than 125 minutes. Also the information about time slots with time ranges is returned for the requested time slots in the 'time_slot_info' nodes.

The following table describes the Capacity data for capacity bucket 'routing' for 4 February, 2014:

Capacity data for capacity bucket 'routing' for 4 February, 2014:

Level Time Slot Capacity Category Capacity (minutes)
Quota Used Available

day

-

-

2000

180

1820

time slot

12-17

-

1000

90

910

capacity category

12-17

MG

100

45

55

Capacity data for capacity bucket ‘planning’ for 4 February, 2014:

Level Time Slot Capacity Category Capacity (minutes)
Quota Used Available

day

-

-

2100

225

1875

time slot

12-17

-

1050

135

915

capacity category

12-17

MG

150

45

105

Capacity data for capacity bucket 'routing' for 5 February, 2014:

Level Time Slot Capacity Category Capacity (minutes)
Quota Used Available

day

-

-

2000

90

1910

time slot

08-12

-

1000

45

955

capacity category

08-12

MG

100

45

55

time slot

12-17

-

1000

45

955

capacity category

12-17

MG

120

45

75

Capacity data for capacity bucket 'planning' for 5 February, 2014:

Level Time Slot Capacity Category Capacity (minutes)
Quota Used Available

day

-

-

2100

0

2100

time slot

08-12

-

1000

0

1000

capacity category

08-12

MG

130

0

130

time slot

12-17

-

1200

0

1200

capacity category

12-17

MG

160

0

160

Activities to be booked:

activity 1, type 'AL', property 'AA_CATEGORY' with value '4', time slot 12 – 17, duration 60 minutes

activity 2, type 'AL', property 'AA_CATEGORY' with value '4', time slot 08 – 12, duration 60 minutes

The returned capacity data shows the following:

the activities to be booked match the 'MG' capacity category which is assigned to two processed capacity buckets

the processed activity type 'AL' has the same duration as the 'default_duration', i.e. 60 minutes

the returned travel time for the activities of such type is 30 minutes

therefore, the required capacity for the activity to be booked is 60 + 30 = 90 minutes

The available capacity is checked at all three levels (day, time slot and capacity category), and an activity can be booked only when the lowest of the three 'available' values is sufficient.

When the capacity required for Activity 1 is compared to the available capacity of both buckets, the capacity of 'routing' is insufficient (only 10 minutes are available at the corresponding capacity category level). Therefore, this activity is to be assigned to the 'planning' bucket which has enough capacity (105 minutes available at the corresponding capacity category level).

Capacity data for capacity bucket 'planning' for 4 February, 2014 after Activity 1 is booked (required capacity 90 minutes):

Capacity data for capacity bucket ‘planning’ for 4 February, 2014:

Level Time Slot Capacity Category Capacity (minutes)
Quota Used Available

day

-

-

2100

315 1785

time slot

12-17

-

1050

225 825

capacity category

12-17

MG

150

135 15

Activity 2 is to be booked for 5 February, 2014, only, as no more activities can be booked for the requested time slot (08-12) on 4 February, 2014.

When the capacity required for Activity 2 is compared to the available capacity of both buckets for 5 February, 2014, the capacity of 'planning' is insufficient (only 55 minutes are available at the corresponding capacity category level). Therefore, this activity is to be assigned to the 'routing' bucket which has enough capacity (130 minutes available at the corresponding capacity category level).

Capacity data for capacity bucket 'routing' for 5 February, 2014 after Activity 2 is booked (required capacity 90 minutes)

Capacity data for capacity bucket 'routing' for 5 February, 2014:

Level Time Slot Capacity Category Capacity (minutes)
Quota Used Available

day

-

-

2100

90

2010

time slot

08-12

-

1000

90

910

capacity category

08-12

MG

130

90

40

time slot

12-17

-

1200

0

1200

capacity category

12-17

MG

160

0

160