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.
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:
- Enter the Events / Work Sessions page.
- Select the Thing Definition to edit.
- Press the Add Work Session button.
- Provide the required information.
- 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.
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.
-
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 custom 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.
Comments
0 comments
Please sign in to leave a comment.