Creates Work Task in TRIRIGA

Creates Work Task in TRIRIGA based on a threshold temperature value.

[{"id":"16dbdb8a.e92424","type":"mqtt-broker","broker":"m2m.eclipse.org","port":"1883","clientid":""},{"id":"e57e138f.1a81f","type":"mqtt in","name":"Reading from MQTT Server","topic":"test/temperature/SP01","broker":"16dbdb8a.e92424","x":124,"y":211,"z":"4a60566d.b59fa8","wires":[["aff9881f.500678"]]},{"id":"166df17f.e9920f","type":"debug","name":"Screen Output","active":true,"console":"false","complete":"payload","x":779,"y":333,"z":"4a60566d.b59fa8","wires":[]},{"id":"aff9881f.500678","type":"switch","name":"Check Threshold value","property":"payload","rules":[{"t":"gt","v":"29"},{"t":"lte","v":"29"}],"checkall":"true","outputs":2,"x":335,"y":279,"z":"4a60566d.b59fa8","wires":[["b3c9fdd8.4c36","b929ccf1.46d63"],["d3f2390d.2c0dc8"]]},{"id":"b929ccf1.46d63","type":"function","name":"Logic","func":"msg.headers= { \"Accept\": \"application/json\", \"Content-Type\": \"application/json;charset=utf-8\"};\nvar dem = msg.payload;\nmsg.payload={\"dcterms:title\":\"Temperature \"+dem+\" \",\"dcterms:description\":\"The temperature is \"+dem+\" degrees\",\"spi:action\":\"Create Draft\",\"spi:triMatrixServiceClassCL\":\"Networking\"};\n\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":185,"z":"4a60566d.b59fa8","wires":[["f607eba2.09f818"]]},{"id":"f607eba2.09f818","type":"http request","name":"","method":"POST","ret":"txt","url":"http://198.11.232.156/oslc/so/triWorkTaskCF","x":802,"y":199,"z":"4a60566d.b59fa8","wires":[[]]},{"id":"d3f2390d.2c0dc8","type":"template","name":"Current Temperature","field":"payload","format":"handlebars","template":"Current temperature is {{payload}} Degree-Celsius","x":417,"y":426,"z":"4a60566d.b59fa8","wires":[["81ab3b41.7e54c8"]]},{"id":"81ab3b41.7e54c8","type":"debug","name":"Screen Output","active":true,"console":"false","complete":"payload","x":792,"y":486,"z":"4a60566d.b59fa8","wires":[]},{"id":"b3c9fdd8.4c36","type":"template","name":"Work Task Creation","field":"payload","format":"handlebars","template":"Work Task has been created for High Temperature {{payload}} Degree-Celsius","x":590,"y":327,"z":"4a60566d.b59fa8","wires":[["166df17f.e9920f"]]}]

Flow Info

Created 7 years, 7 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • debug (x2)
  • function (x1)
  • http request (x1)
  • mqtt in (x1)
  • mqtt-broker (x1)
  • switch (x1)
  • template (x2)

Tags

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