First released in version: 3.2

Shifts

Support the concept of working and non-working time within the business rules

Summary

Within the Business rules it is useful to differentiate between working and non-working time. For example, when measuring the time a process takes, only working time should be measured; non-working time, such as evenings and weekends, should not be included in the process time.

The working time can be defined in the SmartSpace configuration client. It is built up from the working hours in a single 24-hour period which can be assigned to days of the week in a named shift pattern.

The working time is then used by the Business rules engine to calculate the differences between two times in working hours, for example how many hours are worked between 16:30 Monday and 10:00 Tuesday, or to calculate times in the future in working hours, such as what time is four working hours after 17:00 Friday.

If the Visibility component is licensed, the currently configured working- and non-working time used by the Business rules engine can be viewed in a browser-based interface.

Some users can also be given access to change the working time through the web-site according to their SmartSpace roles. For example all workers may be able to view the working time, but only team leaders are allowed to change the working times.

It will vary from place to place who, if anyone, is allowed to change working times through the website. For example, in some factories team leaders can extend their shifts and use overtime.

Configuring Shifts

You configure Shifts using the Shift patterns workspace in SmartSpace Config or, if you have licensed the Visibility component, in the Shifts screen in SmartSpace Web. See Shifts in SmartSpace Web for further details of the latter.

If you have licensed the Rules engine developer, after you have configured shifts and linked them to objects in your data model, you will be able to use durations that take shift patterns into account in your business rules. See Building definitions for details of the hours between, hours in the future and the shift of operators.

In the following example, a single pattern of working hours is defined which is applied to the shift pattern for a standard working week. This pattern is then associated with all objects of the “product” type.

  1. In SmartSpace Config, choose SHIFT PATTERNS and double-click <Create new shift pattern>. In the dialog, enter “Weekday” for the shift pattern, and “8:30->12:00 13:00->16:30” for the working hours. Click Save.

    screenshot showing example of shift pattern setup

  2. Add a new shift by clicking Create shift and entering “Standard Week” as its name. Choose the newly-created Standard Week from the dropdown and assign the “Weekday” shift pattern by double-clicking beside each relevant day and choosing from the list. Days on which there is no working time to be recorded can be left with the default None.

    screenshot showing a shift being selected for a working day

  3. After defining working times, you can associate an object with the shift so that durations for the objects take account of the configured working times. To use the “Standard Week” shift with the “Product” type, choose SERVICE PARAMETERS and select Shifts and then drag the Product type into the object browser. Double-click <'Product' objects> and click Edit. In the parameters dialog, choose Standard Week from the dropdown.

    screenshot of setting shift parameters for all objects of the product type

Parameters for Shifts

The following parameters enable shifts to be used by the Business rules engine and in Reporting.

log duration in shift

Used to record duration using shifts.

report shift activity

Enables setting of the assertion “the shift of <Object> is active” for an object that has a shift assigned to it.

See Service parameters for further information on setting parameters for objects.

Assertions for Shifts

The following assertion is used.

the shift of <Object> is active

If “report shift activity” is set to true for some object with a shift assigned to it, then when that shift is active the assertion “the shift of <Object> is active” will be made (and when the shift is inactive the assertion will be retracted). You can set or unset the ‘shift is active’ assertion for all objects of a particular type by using the global mechanism in SERVICE PARAMETERS to set default values for all members of the chosen type.

One use of this assertion is to configure an event handler to fire at a specific time (e.g. 3 a.m.) by setting up a shift which starts at that time.