Skip to content

Commit 869dd79

Browse files
chore: add deletion of rel between room and health professional when he changes room
1 parent ffc7c54 commit 869dd79

File tree

1 file changed

+123
-10
lines changed

1 file changed

+123
-10
lines changed

data/flows.json

Lines changed: 123 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
"initialize": "",
221221
"finalize": "",
222222
"libs": [],
223-
"x": 1240,
223+
"x": 1500,
224224
"y": 700,
225225
"wires": [
226226
[
@@ -281,7 +281,7 @@
281281
"y": 700,
282282
"wires": [
283283
[
284-
"c4db83d867cd1492"
284+
"0cec540c56ea23b3"
285285
]
286286
]
287287
},
@@ -488,8 +488,8 @@
488488
"targetType": "msg",
489489
"statusVal": "",
490490
"statusType": "auto",
491-
"x": 3520,
492-
"y": 700,
491+
"x": 3540,
492+
"y": 780,
493493
"wires": []
494494
},
495495
{
@@ -1474,8 +1474,8 @@
14741474
"initialize": "",
14751475
"finalize": "",
14761476
"libs": [],
1477-
"x": 2850,
1478-
"y": 760,
1477+
"x": 2830,
1478+
"y": 860,
14791479
"wires": [
14801480
[
14811481
"62c28667af053fe0"
@@ -1501,7 +1501,7 @@
15011501
"once": false,
15021502
"onceDelay": 0.1,
15031503
"topic": "",
1504-
"payload": "{\"type\": 5, \"person_id\": \"health1\", \"person_role\": \"health\", \"room_id\": null} ",
1504+
"payload": "{\"type\": 5, \"person_id\": \"hp10\", \"person_role\": \"health\", \"room_id\": \"room10\"} ",
15051505
"payloadType": "str",
15061506
"x": 110,
15071507
"y": 460,
@@ -1566,7 +1566,7 @@
15661566
"y": 880,
15671567
"wires": [
15681568
[
1569-
"208b6e44f1f2d442"
1569+
"091e1425012342f8"
15701570
],
15711571
[
15721572
"d119d9c78f4ac103"
@@ -1801,12 +1801,125 @@
18011801
"type": "subflow:70865c1f352e8a0c",
18021802
"z": "09012e75c72a4968",
18031803
"name": "",
1804-
"x": 3270,
1805-
"y": 700,
1804+
"x": 3370,
1805+
"y": 780,
18061806
"wires": [
18071807
[
18081808
"3e879afc64077b51"
18091809
]
18101810
]
1811+
},
1812+
{
1813+
"id": "0cec540c56ea23b3",
1814+
"type": "file in",
1815+
"z": "09012e75c72a4968",
1816+
"name": "readActuatorRoomMappingFile",
1817+
"filename": "/data/configFiles/actuator_room_mapping.json",
1818+
"filenameType": "str",
1819+
"format": "utf8",
1820+
"chunk": false,
1821+
"sendError": false,
1822+
"encoding": "utf8",
1823+
"allProps": false,
1824+
"x": 1230,
1825+
"y": 700,
1826+
"wires": [
1827+
[
1828+
"c4db83d867cd1492"
1829+
]
1830+
]
1831+
},
1832+
{
1833+
"id": "3f215909208d5fb3",
1834+
"type": "function",
1835+
"z": "09012e75c72a4968",
1836+
"name": "deleteHealtProfessionalRelationWIthRoom",
1837+
"func": "let room_id = msg.payload[\"value\"][0][\"$targetId\"]\nlet relID = room_id + \"-\" + msg.person_id\nmsg.url = \"https://digital-twin-layer.api.neu.digitaltwins.azure.net/digitaltwins/\" + msg.person_id + \"/relationships/\" + relID + \"?api-version=2023-02-27-preview\"\nmsg.method = \"delete\"\n\nreturn msg",
1838+
"outputs": 1,
1839+
"noerr": 0,
1840+
"initialize": "",
1841+
"finalize": "",
1842+
"libs": [],
1843+
"x": 2250,
1844+
"y": 860,
1845+
"wires": [
1846+
[
1847+
"c19c574b2b54b343"
1848+
]
1849+
]
1850+
},
1851+
{
1852+
"id": "091e1425012342f8",
1853+
"type": "function",
1854+
"z": "09012e75c72a4968",
1855+
"name": "getCurrentRoom",
1856+
"func": "let relName = \"rel_is_inside\"\nmsg.url = \"https://digital-twin-layer.api.neu.digitaltwins.azure.net/digitaltwins/\" + msg.person_id + \"/relationships/?relationshipName=\" + relName + \"&api-version=2023-02-27-preview\"\nmsg.method = \"get\"\n\nreturn msg",
1857+
"outputs": 1,
1858+
"noerr": 0,
1859+
"initialize": "",
1860+
"finalize": "",
1861+
"libs": [],
1862+
"x": 1530,
1863+
"y": 820,
1864+
"wires": [
1865+
[
1866+
"f601941828d90ad1"
1867+
]
1868+
]
1869+
},
1870+
{
1871+
"id": "f601941828d90ad1",
1872+
"type": "subflow:70865c1f352e8a0c",
1873+
"z": "09012e75c72a4968",
1874+
"name": "",
1875+
"x": 1730,
1876+
"y": 820,
1877+
"wires": [
1878+
[
1879+
"7abff071a8097e2f"
1880+
]
1881+
]
1882+
},
1883+
{
1884+
"id": "c19c574b2b54b343",
1885+
"type": "subflow:70865c1f352e8a0c",
1886+
"z": "09012e75c72a4968",
1887+
"name": "",
1888+
"x": 2550,
1889+
"y": 820,
1890+
"wires": [
1891+
[
1892+
"208b6e44f1f2d442"
1893+
]
1894+
]
1895+
},
1896+
{
1897+
"id": "7abff071a8097e2f",
1898+
"type": "switch",
1899+
"z": "09012e75c72a4968",
1900+
"name": "CurrentRoomExistsSwitch",
1901+
"property": "currentRoom",
1902+
"propertyType": "msg",
1903+
"rules": [
1904+
{
1905+
"t": "null"
1906+
},
1907+
{
1908+
"t": "else"
1909+
}
1910+
],
1911+
"checkall": "true",
1912+
"repair": false,
1913+
"outputs": 2,
1914+
"x": 1950,
1915+
"y": 820,
1916+
"wires": [
1917+
[
1918+
"208b6e44f1f2d442"
1919+
],
1920+
[
1921+
"3f215909208d5fb3"
1922+
]
1923+
]
18111924
}
18121925
]

0 commit comments

Comments
 (0)