Workflow Triggers
Sequence Triggers
The sequence workflows can be set to be triggered by different mechanisms. However, a workflow can only run in one instance, so if a workflow is triggered again before the former workflow has completed, the execution will be skipped. The different triggers are:
Direct Command Trigger
This trigger ensures that the sequence workflow is only triggered by calling the a direct method on the SceneControllerModule. When triggering the sequence workflow, you need to specify the id of the sequence. Optionally, it is also possible to set an initial state, by specifying the state names and values, to be used in the workflow. The initial states are pre-loaded before the sequence workflow executes. This is convenient if integration to a control system should be simulated. The initial states can replace tag measurements coming from control systems (using data collector modules).
The direct command trigger is default, if nothing is specified in the sequence workflow. It is defined like this:
"trigger": 
{
    "type": "DirectCommand"
}To execute the sequence workflow, use the following direct method on the SceneControllerModule:
Method Name: StartSequence
Payload:
{
    "id": "<sequence id>",
    "initialState": {
        "<state1>": "<value>",
        "<state2>": "<value>",
        ...
    }
}Schedule Trigger
Sequence workflows can be triggered periodically by setting an execution schedule. The schedule is set using a CRON string, and is configured in the sequence like this:
"trigger": 
{
    "type": "Schedule",
    "parameters": "0/30 * * * *"
}To generate the cron expression string, the following cron expression generator can be used: https://crontab.cronhub.io/ .
OnTagChange Trigger
Sequence workflows can be set to trigger every time a tag value changes. The configuration of the sequence file should look like this:
"trigger": 
{
    "type": "OnTagChange",
    "parameters": "Factory1.Line1.Trigger"
}In the above example, the workflow starts when the tag "Factory1.Line1.Trigger" changes. The tag must be valid in the asset hierarchy.
OnEquationTrue Trigger
Another option to trigger a workflow sequence is to use a symbolic expression. The configuration of the sequence file should look like this:
"trigger": 
{
    "type": "OnEquationTrue",
    "parameters": "a+b>0#a=Factory1.Line1.Tag1;b=Factory1.Line1.Tag2"
}The example shows a simple symbolic equation that is "a+b>0", where the value of "a" comes from the tag "Factory1.Line1.Tag1" and the value of "b" from "Factory1.Line1.Tag2". The symbolic equation should be constructed such that it returns either true or false. However, if an analog value is returned, then values between 0 and 0,5 are interpreted as false. All other values are interpreted as true. Tags must be valid in the asset hierarchy.
Last updated
Was this helpful?