Creates Work Task in TRIRIGA

Step 1 - Import TRIRIGA APIs

Import the latest TRIRIGA APIs OM Package available here

Step 2 - Update TRIRIGA Environment

In the http request node, update the Environment and Credentials details.

image

Step 3 - Define Threshold temperature

In the Sensor Temperature node, define the threshold value of the temperature

image

Step 4 - Deploy the Flow

Deploy the Flow by clicking the Deploy action.

image

Step 5 - Trigger the flow

Trigger the flow by clicking the square button on the left of Sensor Temperature node.

image
[{"id":"f6f2187d.f17ca8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"166df17f.e9920f","type":"debug","z":"f6f2187d.f17ca8","name":"Screen Output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":775,"y":362,"wires":[]},{"id":"aff9881f.500678","type":"switch","z":"f6f2187d.f17ca8","name":"Check Threshold value","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"29","vt":"str"},{"t":"lte","v":"29","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":331,"y":308,"wires":[["b3c9fdd8.4c36","b929ccf1.46d63"],["d3f2390d.2c0dc8"]]},{"id":"b929ccf1.46d63","type":"function","z":"f6f2187d.f17ca8","name":"Logic","func":"msg.headers= { \"Accept\": \"application/json\", \"Content-Type\": \"application/json;charset=utf-8\"};\nvar dem = msg.payload;\nmsg.payload = { \"spi:triNameTX\": \"Temperature \" + dem + \" \", \"spi:triDescriptionTX\": \"The temperature is \" + dem + \" degrees\", \"spi:action\": \"Create Draft\", \"spi:triMatrixServiceClassCL\": \"Networking\", \"spi:triOperationTX\": \"Create/Update\", \"spi:triExternalReferenceTX\": \"Node-Red\"};\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":506,"y":214,"wires":[["f607eba2.09f818"]]},{"id":"f607eba2.09f818","type":"http request","z":"f6f2187d.f17ca8","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://russ-mckay.dyndns.org:8001/oslc/so/triAPICWorkTaskCF","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"basic","senderr":false,"headers":[],"x":798,"y":228,"wires":[[]]},{"id":"d3f2390d.2c0dc8","type":"template","z":"f6f2187d.f17ca8","name":"Current Temperature","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Current temperature is {{payload}} Degree-Celsius","x":413,"y":455,"wires":[["81ab3b41.7e54c8"]]},{"id":"81ab3b41.7e54c8","type":"debug","z":"f6f2187d.f17ca8","name":"Screen Output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":788,"y":515,"wires":[]},{"id":"b3c9fdd8.4c36","type":"template","z":"f6f2187d.f17ca8","name":"Work Task Creation","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Work Task has been created for High Temperature {{payload}} Degree-Celsius","x":586,"y":356,"wires":[["166df17f.e9920f"]]},{"id":"c775d3ed85e23165","type":"inject","z":"f6f2187d.f17ca8","name":"Sensor Temperature","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"30","payloadType":"str","x":230,"y":380,"wires":[["aff9881f.500678"]]}]

Flow Info

Created 9 years, 8 months ago
Updated 1 year, 8 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • debug (x2)
  • function (x1)
  • http request (x1)
  • inject (x1)
  • switch (x1)
  • template (x2)
Other
  • tab (x1)

Tags

Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option