1. Defining the Event and Trigger condition
The purpose of the sheet Event_and_Trigger_Definition is to define the event as well as the trigger condition to be monitored.
The entries in this sheet will be used to create the unique event name and EventTrigger JSON key of the event configuration JSON structure.
Note: The sequence of steps shown in this guide is a recommendation, as it felt the most natural for the author. But users are free to follow their own preferred sequence.
Each event defined using the Litmus Production Record External Event Configurator, needs to have a unique name.
The name of an event configured in the column labeled Event Name.
The user enters the desired event name into the column labeled Event Name.
Important: Do not leave blank rows between entries or at the start. A blank row will be seen as the end of the configuration and the configurator will not process any entry past the blank row.
The configurator will verify the Event Name for invalid ASCII characters. To learn more about which ASCII characters are allowed, review the section Restrictions on ASCII characters allowed to be used. The configurator also validate that the event name is unique.
If an invalid character is found, a prompt is shown to the user.
Invalid characters are marked in red.
As spaces are not a visible character, they can't be marked in red, so the user can make use of the comment added to the cell as well.
A specific Event Name has to be unique.
If the configurator does detect, that a specific event name has already be used, the user is prompted.
The duplicate row will have the column Event Name marked in red.
This allows the user to find the duplicate entry and correct it.
The name of a DeviceHub Tag Name which will be monitored as trigger is configured in the column labeled DeviceHub Tag Name used as Event Trigger.
Important: Do not leave blank rows between entries or at the start. A blank row will be seen as the end of the configuration and the configurator will not process any entry past the blank row.
Note: To allow that the tag can be monitored, the tag will have to be configured on Litmus Edge at least once. If multiple devices have the same tag configured, all can be potentially monitored for the event.
To be able to monitor the DeviceHub tag for an event, the flow from the Litmus solution Litmus Production Record Event Processing Flow does require a Trigger Condition.
The Litmus solution Litmus Production Record Event Processing Flow supports six different conditions.
Trigger Condition | What is monitored |
---|---|
OnValueChange | The node-red flow Litmus Production Record Event Processing Flow will monitor the DeviceHub tag set as Trigger Tag for any change to the value. |
ValueEqualTo | The node-red flow Litmus Production Record Event Processing Flow will monitor the DeviceHub tag set as Trigger Tag if it is equal to the value set. |
OnValueChangeButExclude | The node-red flow Litmus Production Record Event Processing Flow will monitor the DeviceHub tag set as Trigger Tag for any change to the value but will ignore the value set to be excluded. |
OnValueChangeNotIncluded | The node-red flow Litmus Production Record Event Processing Flow will monitor the DeviceHub tag set as Trigger Tag for any change to the value but will ignore if the value contains the substring set to be not included. |
OnValueChangeAndSecondValueEqualTo | The node-red flow Litmus Production Record Event Processing Flow will monitor the DeviceHub tag set as Trigger Tag for any change to the value and that a second trigger is equal to the set value. |
OnValueChangeExcludeZeroAndSecondValueEqualTo | The node-red flow Litmus Production Record Event Processing Flow will monitor the DeviceHub tag set as Trigger Tag for any change to the value except for the value 0 and that a second trigger is equal to the set value. |
The user sets the Trigger Condition by selecting it from the drop-down menu in the column labeled Trigger Condition.
This will add the selected string into the cell.
Note: Only values available through the drop-down menu can be selected.
The column labeled Source of Trigger Value / Source Second Trigger allows the user to define where either the value to monitor against the trigger tag originates from or define the source of a second trigger.
Note: This column does not need to be filled in, if the cell itself is greyed out.
The value to enter will change depending on the choice made in the column labeled Trigger Condition.
- Trigger Condition = OnValueChange
- The cell will be greyed out and the user does not have to insert a value
- Trigger Condition = ValueEqualTo / OnValueChangeButExclude / OnValueChangeNotIncluded
- The user selects one of three values from a drop-down menu
Source of Trigger Value | What is the source | Example |
---|---|---|
ConstantValue | The trigger tag is compared (ValueEqualTo) against a fixed value.
The tag value is monitored for any change except if the value of the tag is this fixed value (OnValueChangeButExclude). The tag value is monitored for any change except if the value of the tag does contain this fixed value (OnValueChangeNotIncluded). | 1 Program1 O9 |
FromFlowVariable | The trigger tag is compared (ValueEqualTo) against the value contained in this Node Red Flow Variable.
The tag value is monitored for any change except if the value of the tag is the value contained in this Node Red Flow Variable (OnValueChangeButExclude). The tag value is monitored for any change except if the value of the tag does contain the value contained in this Node Red Flow Variable (OnValueChangeNotIncluded). Note: This allows users, to be able to modify this value programmatically for example based on a recipe value. Important: The code which updates the flow variable has to be in the same flow tab as the flow monitoring the event configuration. | TriggerTagValue ExcludeTriggerValue DoNotInclude |
FromGlobalVariable | The trigger tag is compared (ValueEqualTo) against the value contained in this Node Red Global Variable.
The tag value is monitored for any change except if the value of the tag is the value contained in this Node Red Global Variable (OnValueChangeButExclude). The tag value is monitored for any change except if the value of the tag does contain the value contained in this Node Red Global Variable (OnValueChangeNotIncluded). Note: This allows users, to be able to modify this value programmatically for example based on a recipe value Hint: The code which updates the global variable can also be in a different flows tab then the flow monitoring the event configuration. | TriggerTagValueEvent1 ExcludeTriggerValueEvent1 DoNotIncludeEvent1 |
- Trigger Condition = OnValueChangeAndSecondValueEqualTo / OnValueChangeExcludeZeroAndSecondValueEqualTo
- The user selects one of two values from a drop-down menu
Source Second Trigger | What is the source | Example |
---|---|---|
FromFlowVariable | The tag value is monitored for any change and the value in the Node Red Flow Variable (OnValueChangeAndSecondValueEqualTo) has to be equal to a defined value. The tag value is monitored for any change except if the value is 0 and the value in the Node Red Flow Variable (OnValueChangeExcludeZeroAndSecondValueEqualTo) has to be equal to a defined value. Note: This allows users, to programmatically monitor a second condition or a combination of several conditions and make the result available to the event monitoring flow. Important: The code which updates the flow variable has to be in the same flow tab as the flow monitoring the event configuration. | SecondCondition SecondCondition |
FromGlobalVariable | The tag value is monitored for any change and the value in the Node Red Global Variable (OnValueChangeAndSecondValueEqualTo) has to be equal to a defined value. The tag value is monitored for any change except if the value is 0 and the value in the Node Red Global Variable (OnValueChangeExcludeZeroAndSecondValueEqualTo) has to be equal to a defined value. Note: This allows users, to programmatically monitor a second condition or a combination of several conditions and make the result available to the event monitoring flow. Hint: The code which updates the global variable can also be in a different flows tab then the flow monitoring the event configuration. | AssetInTrackingMode AssetInTrackingMode |
Based on the Trigger Condition, the user selects the source from the drop-down menu.
Note: Only values available through the drop-down menu can be selected.
Important: Do not leave blank rows between entries or at the start. A blank row will be seen as the end of the configuration and the configurator will not process any entry past the blank row.
Th column labeled Trigger Value / Variable Name allows the user to define either the value to monitor the trigger tag against or define the name of a Node-Red flow or global variable.
Note: This column does not need to be filled in, if the cell itself is greyed out.
The value to enter will change depending on the choice made in the column labeled Source of Trigger Value / Source Second Trigger and the column Trigger Condition.
- Source of Trigger Value / Source Second Trigger = ConstantValue
- The user defines the fixed constant value against which the trigger tag is compared
- Source of Trigger Value / Source Second Trigger = FromFlowVariable / FromGlobalVariable
- Trigger Condition = ValueEqualTo / OnValueChangeButExclude / OnValueChangeNotIncluded
- The user defines the name of the Node-Red flow or global variable which will contain the value against which the tag is compared
- Trigger Condition = OnValueChangeAndSecondValueEqualTo / OnValueChangeExcludeZeroAndSecondValueEqualTo
- The user defines the name of the Node-Red flow or global variable which will contain the second trigger condition
The column labeled Second Trigger Value / Second Variable Name allows the user to define where the value to monitor against the second trigger originates from.
Note: This column does not need to be filled in, if the cell itself is greyed out.
The value to enter will change depending on the choice made in the column labeled Trigger Condition.
- Trigger Condition = OnValueChange / ValueEqualTo / OnValueChangeButExclude / OnValueChangeNotIncluded
- The cell will be greyed out and the user does not have to insert a value
- Trigger Condition = OnValueChangeAndSecondValueEqualTo / OnValueChangeExcludeZeroAndSecondValueEqualTo
- The user selects one of two values from a drop-down menu
Source of Trigger Value | What is the source | Example |
---|---|---|
ConstantValue | The second trigger is compared against a fixed value. | 1 |
FromFlowVariable | The second trigger tag is compared against the value contained in this Node Red Flow Variable. Note: This allows users, to be able to modify this value programmatically for example based on a recipe value. Important: The code which updates the flow variable has to be in the same flow tab as the flow monitoring the event configuration. | SecondTriggerValue |
FromGlobalVariable | The second trigger is compared against the value contained in this Node Red Global Variable.
Note: This allows users, to be able to modify this value programmatically for example based on a recipe value Hint: The code which updates the global variable can also be in a different flows tab then the flow monitoring the event configuration. | SecondTriggerValueEvent1 |
Based on the Trigger Condition, the user selects the source from the drop-down menu.
Note: Only values available through the drop-down menu can be selected.
Important: Do not leave blank rows between entries or at the start. A blank row will be seen as the end of the configuration and the configurator will not process any entry past the blank row.
Th column labeled Second Trigger Value / Second Variable Name allows the user to define the value to monitor the second trigger against or define the name of a Node-Red flow or global variable.
Note: This column does not need to be filled in, if the cell itself is greyed out.
The value to enter will change depending on the choice made in the column labeled Source of Second Trigger Value.
- Source of Second Trigger Value = ConstantValue
- The user defines the fixed constant value against which the second trigger is compared
- Source of Second Trigger Value = FromFlowVariable / FromGlobalVariable
- The user defines the name of the Node-Red flow or global variable which will contain the value against which the second trigger is compared
The Litmus solution Litmus Production Record Event Processing Flow will publish the event data for the defined data model Items after a trigger condition has been true using the Litmus Message Broker.
This allows a large degree of freedom when it comes to sending the data to Litmus Production Record Database.
While it is recommended to use a Litmus Integration to the send the event data to Litmus Production Record Database, users can also choose other methods like Node-Red or custom docker applications to handle this task.
To be able to publish the event data using Litmus message Broker, the user needs to define the topic prefix (first part of the topic) under which the event data are published. The topic prefix is configured in the column labeled Topic used when publishing to Message broker.
The user enters the desired topic into the column labeled Topic used when publishing to Message broker.
The defined prefix is used to build for each data mode litem a distinct Litmus Message Broker Topic using the unique event name, the Litmus Edge DeviceHub Device name for which the event was observed ending on a combination of the DeviceHub Tag name and the number of the Item it was used to populate.
- Example: LitmusProRec.SerialNo_Tracking_Asset.Data_Asset1.ExecProgNo_name_Item1
Important: Do not leave blank rows between entries or at the start. A blank row will be seen as the end of the configuration and the configurator will not process any entry past the blank row.
The configurator will verify the Topic for invalid ASCII characters. To learn more about which ASCII characters are allowed, review the section Restrictions on ASCII characters allowed to be used.
If an invalid character is found, a prompt is shown to the user.
Invalid characters are marked in red.
As spaces are not a visible character, they can't be marked in red, so the user can make use of the comment added to the cell as well.
To make it easier to subscribe to the all the topics which are published by the flow from the Litmus solution Litmus Production Record Event Processing Flow , the same topic prefix should be used for all events.
This way, it is possible to use a wildcard
- LitmusProRec.>
on the topic prefix to make sure to not miss any events.