Skip to content

Commit 1c8ae31

Browse files
committed
docs: add further examples and updated description
1 parent 8a24468 commit 1c8ae31

File tree

19 files changed

+695
-10
lines changed

19 files changed

+695
-10
lines changed

.github/workflows/action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Check Markdown links
2+
3+
on: push
4+
5+
jobs:
6+
markdown-link-check:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@master
10+
- uses: gaurav-nelson/github-action-markdown-link-check@v1

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changelog - VFC Examples
22

3-
## VFC 1.0.0
3+
## VFC Examples 1.0.0
44

55
- Initial Version

README.md

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
1-
# Visual Flow Creator Examples
1+
# MindSphere Visual Flow Creator Examples
22

33
[![The MDL License](https://img.shields.io/badge/license-MDL-009999.svg?style=flat)](./LICENSE.md)
44
[![Documentation](https://img.shields.io/badge/mindsphere-documentation-%23009999.svg)](https://opensource.mindsphere.io/docs/mindconnect-nodejs/index.html)
55
[![Forum](https://img.shields.io/badge/mindsphere-community-%23009999.svg)](https://community.plm.automation.siemens.com/t5/Developer-Space/bd-p/MindSphere-platform-forum)
66

7+
# Welcome
8+
* You are interested in MindSphere?
9+
* You want to know, what you can do with it?
10+
* You've heard about Visual Flow Creator and want to try it out?
11+
* You know already Visual Flow Creator but search for examples?
12+
* You want to get inspired by other flows from the community?
13+
14+
This repository provides example flows to be used in MindSphere Visual Flow Creator (VFC). You can use them and try it out to get an impression what is possible. Additionally you can customize them to your use cases. And of course you can contribute to this repository and share your knowledge to others.
15+
16+
If you do not have already purchased the app, you can get it in the [MindSphere Store](https://www.dex.siemens.com/mindsphere/applications/Visual-Flow-Creator). Or if you do not already have a MindSphere account, get one at [MindSphere Start](https://www.mindsphere.io/start).
17+
18+
## How does this works
19+
20+
In the next chapter you will find example flows. There is always a readme with a short description, what this flow does.
21+
There is an image showing the flow to get an impression of the complexity.
22+
23+
And there is the most important thing - the json file, which you can import as a new flow into your Visual Flow Creator.
24+
25+
Please note, that the json-files are exported from another tenant. So their might be fields which you have to adapt, that the flow is able to run in your tenant.
726

827
## Example Overview
928

10-
Current examples in this repository for Visual Flow Creator (VFC):
29+
### Current examples in this repository for Visual Flow Creator (VFC):
1130

1231
| Name | Description | Complexity Rating | Prerequisites |
1332
| --- | --- | --- | --- |
@@ -17,8 +36,26 @@ Current examples in this repository for Visual Flow Creator (VFC):
1736
| [Generate sample data](./generateSampleData/readme.md) | Demo data for different data types in MindSphere | :star: | |
1837
| [Virtual machine simulator](./virtualMachineSimulator/readme.md) | | :star: | |
1938

39+
### Examples which have to be added:
40+
| Name | Description | Complexity Rating | Prerequisites |
41+
| --- | --- | --- | --- |
42+
| [TODO: Create dashboard for Fleet Manager](./createDashboardForFleetManager/readme.md) | | :star: | |
43+
| [TODO: Integrate external API](./integrateExternalApi/readme.md) | | :star: | |
44+
45+
You can add here your ideas for further examples.
46+
47+
### Example template
48+
49+
You want to create your own example? Just copy the [template flow-directory](./templateFlow/), adapt it and send us your pull request.
50+
## Remarks
51+
52+
Please note that the screenshots show just the current state, when these examples have been created. They might differ to the latest software release.
53+
54+
Each flow has to be adapted to your tenant. Ensure, that e.g. fixed tenant names or asset ids are adapted before/after you import the flow.
55+
2056
## Prerequisites
21-
All application examples shown in this respository require the *Visual Flow Creator* MindSphere Application.
57+
All application examples shown in this repository require the MindSphere Application *Visual Flow Creator (VFC)*.
58+
2259
To use them, ensure that
2360
- VFC is available in your MindSphere tenant ([VFC in MindSphere Store](https://www.dex.siemens.com/mindsphere/applications/visual-flow-creator))
2461
![image](./MindSphere_Launchpad_VFC.png)
@@ -28,7 +65,17 @@ To use them, ensure that
2865
If you can see Visual Flow Creator on your Launchpad, you're ready to start developments.
2966

3067
## Import of Examples
31-
To import any of the examples shown in this repository, launch the VFC. In the menu, select *Import* and paste the JSON template as found in the application examples.
32-
Drop the nodes in the editor and save the just imported flow.
68+
69+
- To import any of the examples shown in this repository, launch the VFC.
70+
- In the menu, select *Import* and paste the JSON template as found in the application examples.
71+
- Drop the nodes in the editor and save the just imported flow.
72+
3373
![image](./How_To_Import.gif)
3474

75+
## Questions and answers
76+
77+
Feel free to ask your questions in the [MindSphere Developer Forum](https://community.sw.siemens.com/s/topic/0TO4O000000MihsWAC).
78+
79+
Or open an [issue](https://github.com/mindsphere/vfc-examples/issues) if you find a bug in our examples.
80+
81+
You want to contribute? Your pull request is always welcome!

commandMqttDevice/readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Every time the flow is triggered, the command specified in the payload is send t
66
![image](./doc/commandMqttDevice.png)
77

88
## Prerequisites
9-
- [access to Visual Flow Creator](xxx)
10-
- [access to IoT Extension](xxx)
9+
- Access to Visual Flow Creator
10+
- Access to IoT Extension
1111

1212
## Setup & Configuration
1313

1414
### Setup in IoT Extension
15-
1. Create a device account to be used from IoT Extensions manually ([see Manage users]([xxx](https://documentation.mindsphere.io/resources/html/mindconnect-iot-extension/en-US/120385099019.html))) or via the [Device Integration](https://cumulocity.com/guides/device-sdk/rest/#device-integration) process for automatically obtained device credentials. Note that you will need this credentials later in VFC as well.
15+
1. Create a device account to be used from IoT Extensions manually ([see Manage users](https://documentation.mindsphere.io/resources/html/mindconnect-iot-extension/en-US/120385099019.html)) or via the [Device Integration](https://cumulocity.com/guides/device-sdk/rest/#device-integration) process for automatically obtained device credentials. Note that you will need this credentials later in VFC as well.
1616
2. Connect to IoT Extension via your MQTT client of choice. The detailed process is described [here](https://developer.mindsphere.io/howto/howto-mqtt-mciot.html)
1717
3. Follow the process to [create your MQTT device](https://cumulocity.com/guides/device-sdk/mqtt-examples/#hello-mqtt) by sending ```100,My first MQTT device,MqttDeviceType``` to ```s/us``` topic. Once you can see the device showing up in your device list, you're ready for the next step.
1818
![image](./doc/create_MQTT_device.png)
@@ -50,7 +50,7 @@ Follow the device logic to now acknowledge this command and use it for your appl
5050
- [Device Control for IoT Extension](https://cumulocity.com/guides/reference/device-control/)
5151
- [GitHub: Cumulocity MQTT client examples](https://github.com/SoftwareAG/c8y_hw_mqtt)
5252
- [:shopping_cart: MindSphere Store: Visual Flow Creator](https://www.dex.siemens.com/mindsphere/applications/visual-flow-creator?viewState=DetailView&cartID=&portalUser=&store=&cclcl=en_US)
53-
- [:shopping_cart: MindSphere Store: IoT Extension](mindsphere.io/store)
53+
- [:shopping_cart: MindSphere Store: IoT Extension](https://mindsphere.io/store)
5454

5555

5656

44.4 KB
Loading
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# FLOW: Create dashboard for Fleet Manager
2+
3+
TODO
4+
5+
<!-- Insert a description for the example flow. Describe the use case or its specialty. -->
6+
7+
# Example image
8+
<!-- Insert an example image -->
9+
<!-- ![image](./doc/example.png) -->
10+
11+
# How to
12+
13+
<!-- Describe the necessary steps to get this flow running -->
14+
15+
# How does this flow works
16+
17+
<!-- Describe the flow and how it works -->
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// insert your exported json here
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
[{
2+
"id": "8f12e86e.fc4c",
3+
"type": "asset-type",
4+
"z": "bf4ef0cb.2b46e8",
5+
"name": "",
6+
"topic": "[MobilePhone]/Acceleration/x",
7+
"assetType": "free4h1w.mobilephone",
8+
"asset": "",
9+
"exclude": "",
10+
"aspect": "Acceleration",
11+
"variable": "x",
12+
"x": 240,
13+
"y": 180,
14+
"wires": [
15+
["a334ede2.883c2"]
16+
],
17+
"_type": "node"
18+
}, {
19+
"id": "72e48473.3782dc",
20+
"type": "comment",
21+
"z": "bf4ef0cb.2b46e8",
22+
"name": "",
23+
"info": "select all assets of this type",
24+
"sticky": 1,
25+
"x": 310,
26+
"y": 140,
27+
"wires": [],
28+
"_type": "node"
29+
}, {
30+
"id": "9d1feea5.530c48",
31+
"type": "create event",
32+
"z": "bf4ef0cb.2b46e8",
33+
"name": "",
34+
"asset": "",
35+
"assetName": "",
36+
"severity": "40",
37+
"acknowledged": "false",
38+
"source": "VFC rule test",
39+
"description": "VFC rule triggered",
40+
"x": 910,
41+
"y": 360,
42+
"wires": [],
43+
"_type": "node"
44+
}, {
45+
"id": "efde183f.4a7a88",
46+
"type": "filter2",
47+
"z": "bf4ef0cb.2b46e8",
48+
"name": "my rule",
49+
"lambda": "element.x > 30",
50+
"x": 600,
51+
"y": 180,
52+
"wires": [
53+
["9dd878e6.d1f218"]
54+
],
55+
"_type": "node"
56+
}, {
57+
"id": "9dd878e6.d1f218",
58+
"type": "function",
59+
"z": "bf4ef0cb.2b46e8",
60+
"name": "",
61+
"func": "msg.asset = msg.topic.split('/')[0];\nreturn msg;",
62+
"outputs": 1,
63+
"noerr": 0,
64+
"x": 480,
65+
"y": 360,
66+
"wires": [
67+
["27c8a409.05bcd4", "80b538c6.7f079"]
68+
],
69+
"_type": "node"
70+
}, {
71+
"id": "d10d784d.7c141",
72+
"type": "inject",
73+
"z": "bf4ef0cb.2b46e8",
74+
"name": "Trigger",
75+
"topic": "",
76+
"payload": "",
77+
"payloadType": "date",
78+
"repeat": "",
79+
"crontab": "",
80+
"once": false,
81+
"properties": "",
82+
"timezone": "utc",
83+
"betweentimesunit": "m",
84+
"enableRuleEngine": false,
85+
"x": 110,
86+
"y": 180,
87+
"wires": [
88+
["8f12e86e.fc4c"]
89+
],
90+
"_type": "node"
91+
}, {
92+
"id": "a334ede2.883c2",
93+
"type": "read timeseries",
94+
"z": "bf4ef0cb.2b46e8",
95+
"name": "",
96+
"topic": "",
97+
"topicLabel": "",
98+
"assetName": "",
99+
"period": "60",
100+
"offset": "0",
101+
"mode": "relative",
102+
"from": "",
103+
"datetimepickerFrom": "",
104+
"to": "",
105+
"datetimepickerTo": "",
106+
"timezoneoffset": 0,
107+
"x": 400,
108+
"y": 180,
109+
"wires": [
110+
["efde183f.4a7a88"]
111+
],
112+
"_type": "node"
113+
}, {
114+
"id": "60954bf3.6cbbec",
115+
"type": "send email",
116+
"z": "bf4ef0cb.2b46e8",
117+
"name": "",
118+
"recipients": "",
119+
"subject": "Example rule per asset type has been triggered",
120+
"message": "Your rule has been triggered:\n\n${payload}",
121+
"mode": "subject",
122+
"categoryId": "",
123+
"category": "",
124+
"priority": "normal",
125+
"x": 910,
126+
"y": 320,
127+
"wires": [],
128+
"_type": "node"
129+
}, {
130+
"id": "80b538c6.7f079",
131+
"type": "debug",
132+
"z": "bf4ef0cb.2b46e8",
133+
"name": "",
134+
"active": true,
135+
"console": "false",
136+
"xaxis": "_time",
137+
"complete": "payload",
138+
"x": 670,
139+
"y": 400,
140+
"wires": [],
141+
"_type": "node"
142+
}, {
143+
"id": "27c8a409.05bcd4",
144+
"type": "switch",
145+
"z": "bf4ef0cb.2b46e8",
146+
"name": "",
147+
"property": "payload[0]",
148+
"propertyType": "msg",
149+
"rules": [{
150+
"t": "nnull"
151+
}],
152+
"checkall": "true",
153+
"outputs": 1,
154+
"x": 650,
155+
"y": 360,
156+
"wires": [
157+
["9d1feea5.530c48"]
158+
],
159+
"_type": "node"
160+
}, {
161+
"id": "6fe9315d.1fe0e",
162+
"type": "comment",
163+
"z": "bf4ef0cb.2b46e8",
164+
"name": "",
165+
"info": "read the timeseries data",
166+
"sticky": 1,
167+
"x": 430,
168+
"y": 220,
169+
"wires": [],
170+
"_type": "node"
171+
}, {
172+
"id": "9007c78e.7ea2e",
173+
"type": "comment",
174+
"z": "bf4ef0cb.2b46e8",
175+
"name": "",
176+
"info": "define the rule\nin this case: value > 30",
177+
"sticky": 1,
178+
"x": 650,
179+
"y": 120,
180+
"wires": [],
181+
"_type": "node"
182+
}, {
183+
"id": "68612bd.76696d4",
184+
"type": "comment",
185+
"z": "bf4ef0cb.2b46e8",
186+
"name": "",
187+
"info": "extract data and fire only an event,\nif the rule has been triggred",
188+
"sticky": 1,
189+
"x": 580,
190+
"y": 300,
191+
"wires": [],
192+
"_type": "node"
193+
}, {
194+
"id": "2ca5fc2c.159afc",
195+
"type": "comment",
196+
"z": "bf4ef0cb.2b46e8",
197+
"name": "",
198+
"info": "fire an action:\ncreate an event or\nsend a email",
199+
"sticky": 1,
200+
"x": 930,
201+
"y": 240,
202+
"wires": [],
203+
"_type": "node"
204+
}]
Loading

createRuleForAssetType/readme.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# FLOW: Create rule for assets of a specific asset type
2+
3+
You might created a flow where you monitor a single variable for a defined condition. But how can you simply roll this out to all assets of this type without much effort? Just use the `asset type`-node and try the following example.
4+
5+
# Example image
6+
7+
![image](./doc/createRuleForAssetType.png)
8+
9+
# How to
10+
11+
- Import the flow in Visual Flow Creator
12+
- Double click the asset type node and select an asset type in your tenant
13+
14+
# How does this flow works
15+
16+
- the flow is triggered by the inject node
17+
- with the `asset type` node VFC will get all assets of a specific type and perform the action for all assets of this type
18+
- you can also disable specific assets, that they are not used
19+
- for all of this assets a rule is checked and an email can be sent or a MindSphere event can be created
37.2 KB
Loading

0 commit comments

Comments
 (0)