Libelium Conditionals¶
Conditionals or Execution Conditions give you the power to decide if a particular action on MySQL will be performed or not when the workflow is triggered by the incoming event. This is similar to applying "if-then-else" logic to the execution of an action based on the attribute value coming from the workflow's trigger event.
You can add conditions to any action in your workflow.
To decide which actions should be performed in response to a particular trigger based on its characteristics or the data attributes. you can even apply a complex logic using AND, OR, and grouping of such conditions.
Each of the Conditionals support different operators based on the passed data type like string, number, Boolean, etc. Read here to learn more about Execution Conditions.
Example Scenario¶
To better illustrate Execution conditions, we will take a scenario where you are using IoT devices to monitor the humidity level of fertilizer in a storage silo. When the humidity level rises beyond a specific point a ServiceNow (Privileged) incident will be created and SMS notification will be sent out.
SMS notification and ServiceNow actions would be applied based on conditions which would also use the data attributes of the Libelium trigger event. This will allow each of the actions to execute independently based on its defined execution conditions.
When you use Libelium as a trigger application, the following attributes will be available to you when you are configuring your application action:
- Altitude
- Latitude
- Wasp ID
- Wasp Name
- Parser Type
- Sensor Description
- Measurement
- Longitude
- Timestamp
In Figure 1 below, the action on ServiceNow (Privileged) will only be performed if the wasp name
contains Silo and the measurement
or humidity is greater than 82.4%.
Similarly in Figure 2 below, in the same workflow, a SMS will be sent to a manager's phone using the company's Twilio account if the wasp name
contains Silo and the measurement
or humidity is greater than 92.8%.