-
Notifications
You must be signed in to change notification settings - Fork 2
/
smartflo_isteer_workstation.json
156 lines (156 loc) · 4.65 KB
/
smartflo_isteer_workstation.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
{
"name": "smartflo-isteer-workstation",
"type": "flogo:app",
"version": "0.0.1",
"appModel": "1.1.0",
"description": "This Application will register the respective workstation of an iSteer Employee and send event reports and messages to the Smartflo platform for device monitoring and network utilization metrics for understanding behaviour patterns ",
"imports": [
"github.com/project-flogo/contrib/activity/log",
"github.com/project-flogo/contrib/trigger/timer",
"github.com/project-flogo/flow",
"github.com/shaliniGovindaNayak/flogo-workspace/activity/azureiot",
"github.com/shaliniGovindaNayak/flogo-workspace/activity/cosmodb",
"github.com/shaliniGovindaNayak/flogo-workspace/activity/hardware",
"github.com/shaliniGovindaNayak/flogo-workspace/activity/macaddr"
],
"triggers": [
{
"id": "timer_start",
"ref": "#timer",
"name": "Timer-Start",
"description": "Timer to Start the operation of registering device to IoT Hub",
"handlers": [
{
"settings": {
"startDelay": "1s"
},
"action": {
"ref": "#flow",
"settings": {
"flowURI": "res://flow:device_registration"
}
}
},
{
"settings": {
"startDelay": "5s",
"repeatInterval": "5s"
},
"action": {
"ref": "#flow",
"settings": {
"flowURI": "res://flow:device_data_submission"
}
}
}
]
}
],
"resources": [
{
"id": "flow:device_registration",
"data": {
"name": "Device Registration",
"description": "This flow registers a new device on the Azure IoTHub platform",
"tasks": [
{
"id": "macaddr_2",
"name": "Get MAC Address",
"description": "Fetches the Hardware details of the device",
"activity": {
"ref": "#macaddr"
}
},
{
"id": "azureiot_3",
"name": "Device Registration ",
"description": "Performs CRUD operations of device management in Azure IOT Hub",
"activity": {
"ref": "#azureiot",
"input": {
"connectionString": "HostName=smartflo-beta.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=XC9wn6yF5APFphRMCGQyo9jOh+CWpvRkK49rEnRz0fI=",
"Type of Operation": "Add Device",
"Deviceid": "=$activity[macaddr_2].Output"
}
}
},
{
"id": "log_4",
"name": "Log",
"description": "Logs a message",
"activity": {
"ref": "#log",
"input": {
"message": "Device Registerd successfully",
"addDetails": false
}
}
}
],
"links": [
{
"from": "macaddr_2",
"to": "azureiot_3"
},
{
"from": "azureiot_3",
"to": "log_4"
}
]
}
},
{
"id": "flow:device_data_submission",
"data": {
"name": "Device data submission",
"description": "This flow submits the device hardware details to Azure cosmoDB",
"tasks": [
{
"id": "hardware_2",
"name": "Hardware Details",
"description": "Fetches the hardware Address",
"activity": {
"ref": "#hardware"
}
},
{
"id": "cosmodb_3",
"name": "Cosmo DB",
"description": "activity to create insident",
"activity": {
"ref": "#cosmodb",
"input": {
"Connectionstring": "smartflo-iotdata.documents.azure.com:10255",
"Content": "=$activity[hardware_2].Output",
"Password": "0E594yhEhx7UVptwtVGeAam5IOfLBcPMJzxFxDyo3TUjeOAI5wuPcTXRCgLomUnLhgo1KFcP1L5OQ7sDrsUvZA==",
"Username": "smartflo-iotdata"
}
}
},
{
"id": "log_4",
"name": "Log",
"description": "Logs a message",
"activity": {
"ref": "#log",
"input": {
"addDetails": false,
"message": "=$activity[cosmodb_3].Output"
}
}
}
],
"links": [
{
"from": "hardware_2",
"to": "cosmodb_3"
},
{
"from": "cosmodb_3",
"to": "log_4"
}
]
}
}
]
}