Work Sessions

Servitly allows tracking jobs and tasks performed by the products, providing the user with helpful productivity information.

The Work Session Definition allows modeling a job or task performed by the product, and tracking its execution.

A work session instance stores all the information about status, start/end time, duration, extra-time, and the monitored metrics with the relative recorded values (initial, minimum, maximum, last).

Monitored metrics can be used in work session statistics (also aggregated) to check, for instance, consumption, and product performance (e.g. timing, number of pieces).

Creating a Work Session Definition

To add a new Work Session to a Thing Definition, you should:

  1. Enter the Events / Work Sessions page.

  2. Select the Thing Definition to edit.

  3. Press the Add Work Session button.

  4. Provide the required information.

  5. Press the Save button and edit the additional information, if needed.

Editing a Work Session Definition

Once a Work Session Definition has been saved, you can configure more information on it.

General

  • Name: specifies the name of the work session, it is a free value (e.g. COOKING, PRINTING, CLEANING).

  • Title: the work session title, shown within the work-session-list.

  • Description: the text describing the work session.

  • Work session details template: a template of the parent thing-definition used to display the work-session details. Data loaded from the widgets placed into this template are automatically limited to the work-session start and end timestamps. For instance, a time-series chart displays the metric values collected during the work-session execution.

Within the work session Title, and Description it is possible to use placeholders to include information about the thing, the event, and measures.

Start and Stop Condition

Within the Start and Stop condition sections, you can define the metric based conditions that are verified by the backend to:

  • Determine when the work session must be registered.

  • Determine when a running work session must be stopped.

In case the Work Session is not User Reported:

  • If the stop condition is not specified, the negated start condition is used.

  • To start a new work session, the activation timestamp of the stop condition must be prior to the activation timestamp of the start condition, and there are no work sessions of the same type still active.

  • Start and stop conditions are evaluated periodically (e.g. 60 seconds), and all data points present (in respect to the last evaluation) are processed to determine whether a work session should be started or stopped.

Monitoring

This section allows selecting the metrics which must be monitored during the work session execution.

For each monitored metric referenced by the work session, the following properties can be displayed within the work session lists:

  • INITIAL: the metric initial value.

  • CURRENT: the metric current value, or last, if the work session has been completed.

  • MIN: the minimum metric value reached during the work session.

  • MAX: the maximum metric value reached during the work session.

  • DELTA: the variation between the INITIAL and the CURRENT metric value.

Here is reported a sample template showing how to display monitored metrics.

<active-work-session-list-widget title="Active Cookings">
 <property name="name" [label]="'Recipe'" [filter]="'recipeImage'"></property>
 <property name="date" [label]="'Start Time'"></property>
 <property name="metrics.Progress.CURRENT" label="Progress" filter="progressBar"></property>
 <property name="metrics.Temperature.CURRENT" label="Temperature" filter="twoDecimalFormatDefault"></property>
 <property name="metrics.Daily Energy.DELTA" label="Energy [kWh]" filter="energy"></property>
</active-work-session-list-widget>

Post Computations

This section allows you to define Algorithm-based computations to be executed on work session completion.

By pressing the Add Post Computation button, you can specify the field name used to save the Post Computation result in the work session object, the Algorithm and configure its Inputs.

Note that you can only use algorithms that have the Work Session Post Computation usage, for more details refer to the Defining Algorithms article.

The defined post computations are automatically executed when a work session completes. The algorithm receive as inputs, the inputs specified in the post computation configuration dialog, and the work session object itself. Data related to inputs of type METRIC or EVENTS are automatically limited to the work session duration, so there is no need to specify a Data Set Range, as in the case of Insight Metrics.

The algorithm result will be saved in the work session object, where you can find a new field named postComputationResults, which is a map containing a field for each defined post computation, each of them contains the algorithm result.

{
	"id": "65bcc71a07b5f872d0924860",
	"name": "Cooking",
	"title": "Cooking",
	"startTimestamp": 1706869831627,
	"endTimestamp": 1706870533278,
	"thingId": "65045032bfca8f688c9cede1",
	"workSessionDefinitionId": "64ff12873ab17956390a3372",
	"metrics": {},
	"thing": {},
	"location": {},
	"customer": {},
	"thingDefinition": {},
	"group": "Production",
	"postComputationResults": {
		"timing": {
			"effectiveTime": 1234,
			"pauseTime": 1234
		},
		"validation": {
			"status": "SUCCESS"
		}
	}
}
 

In the template you can display post computation values by using standard property tags.

<property name="postComputationResults.validation.status" filter="statusBadge"></property>
<property name="postComputationResults.timing.effectiveTime" filter="millisToPeriod"></property>

In the same way you can also use these properties into statistics.

Limits

  • You can define up to 3 post computation for each work session definition.

  • Serialization of each post computation cannot be longer than 500 characters.

  • For each input metric, a maximum of 50k values can be extracted in the past with respect to the timestamp at the end of the work session.

Notifications

This section allows you to configure notification messages to be sent to users when starting or stopping a work session. Within the notification messages it is possible to use placeholders to include information about the thing, the event, and measures.

Displaying Work Sessions

Once you have created a Work Session Definition, Servitly will immediately start checking start and stop condition on the incoming metrics values.

When a Start Condition is triggered, a new Work Session is created and associated with the Thing.

While a work session is running, the system periodically updates the Monitored Metrics. When a Stop Condition is triggered or the Start Condition becomes FALSE, the active work session is updated and saved within the completed work sessions.

Work session status evaluation is asynchronously processed (every 30 seconds), so a work session may be activated in near real-time.

The line manager can verify the productivity of the machine(s), make queries on the historical base, and have an overview of the productivity statistics by work session type, period, and product model (overall and by customer or location).

The active and completed work sessions can be visualized through specific widgets:

Aside the main menu item, you can display the number of active work-sessions.