ThingWorx Flow > ThingWorx Alert Management Flow
  
ThingWorx Alert Management Flow
This flow illustrates a service use case where a generator alert occurs, and results in a service case and then sends an e-mail or SMS notification.
When a generator alert occurs, the flow is automatically triggered.
The generator properties (fuel level, engine temperature, model number, serial number and location) are acquired from the generator Thing instances for which the alert occurred.
A Refueling service case is created in Trello for the low fuel level alert event and an e-mail with the service case and location is sent to a service provider.
An emergency service case is created in Trello for the high engine temperature alert branch and an SMS text is sent to the operator’s phone of the record to shut down the generator to prevent damage. The text includes the model, serial number, engine temp and map location link.
Creating a Thing Template and Alerts
1. Navigate to the ThingWorx Platform and create your Thing Template based on GenericThing template with the properties as shown in the figure:
2. Create Alerts as shown in the figure that follows:
3. Create your Thing which will be based on the Thing Template that we created in step 1
4. Navigate to the workflow, and then create a new ThingWorx Alert Management flow:
5. Click , and then search for the ThingWorx trigger.
6. Add a new connection to connect to your ThingWorx platform, and then enter the following details:
Connection Label—Autopopulated. You can provide the connection label of your choice.
ThingWorx URL—<https://<hostname>/Thingworx>
User IdAdministrator
Password— <password configured in the platform-settings.json file>.
7. Select Source Entity as Thing which you created in Step 3 in ThingWorx Platform, and then click SAVE
Adding the ThingWorx Action
1. In the activity input field, search for the ThingWorx Get Thing Properties action and drag and drop on the canvas from the right panel.
2. In the Configuration window for Get Thing Properties action, provide following details as shown and click Done.
Adding Trello Actions
1. From the right panel, search for the Add Card action and drag and drop on the canvas.
2. In the configuration window for Add Card action, establish a connection to the Trello system.
3. After successful authentication, provide information from your Trello account, and then click Done.
4. Drag another Trello Add Card action and enter information as shown below, and then click Done.
Adding Office 365 Actions
1. From the right panel, search for the Office 365 Send an Email action and drag to the canvas.
2. In the configuration window for Office 365 Send an Email action, establish a connection to the your Office 365 account.
3. After successful authentication, provide information as given below, and then click Done.
Adding Twilio Actions
In the configuration window for Twilio Send an SMS action, you will first need to establish a connection to the your Twilio account. After you successfully authenticate, provide information as below and click Done.
Connecting the Actions and Setting the Conditions
1. Connect all the actions as shown and click Save.
When you place the pointer on the condition lines, it displays the settings icon ().
2. Click . The Condition configuration window opens.
3. Set the condition as shown in the figure above, and then click Done.
4. Place the pointer on the arrow as shown in the figure that follows:
5. Click . to set the condition, and then click Done
Verifying the Triggered Flow
1. Navigate to the ThingWorx Platform and update the Engine Temperature property value to 300.
2. Verify that the flow is triggered as shown in the figure that follows and an emergency service case is created in Trello for the high engine temperature alert branch and an SMS delivered text is sent to the phone of the operator.
A text message is received on the operators phone as shown below:
The following video demonstrates how to add conditional branching with any workflow.