Skip to content

Commit f59f199

Browse files
authored
chore: release 3.12.0 (#133)
* feat: assetinfo + customcode * chore: alpha release: 3.12.0-1 🎉 * docs: assetinfo and sdk function docs * chore: release 3.12.0 🎉 * chore: fixed test * feat: error handling for new messages
1 parent 3ba791e commit f59f199

10 files changed

+420
-133
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Changelog
22

3-
## 3.12.0 (Vienna Siberian Tigers) - June 2021
3+
## 3.12.0 (Vienna Siberian Tigers) - May 2021
44

55
## New Features 3.12.0
66

7+
- Support for "bidirectional" communication with MindSphere [#129]
8+
- new message type to read asset information [#129]
9+
- new message type to execute a custom javascript script using MindSphere javascript/typescript SDK [#129]
710
- Bumped all dependencies
811

912
## 3.11.0 (Vienna Jaguarundi) - March 2021

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,38 @@ Please note:
214214
- You can pass either a javascript buffer or path to file in the dataLakeFile property for upload
215215
- The subTenantId can be optionally added to the messsage
216216

217+
#### Reading Asset Information
218+
219+
You can read the data (e.g. static asset variables, or full asset information) from MindSphere using the following message. This can be used to implement a "digital shadow/digital twin" pattern, where the change in the MindSphere variables is reflected to the real world asset. See [bidirectional communication example flow](https://playground.mindconnect.rocks/#flow/9ff72be.3d502d8) on playground for a full example.
220+
221+
```javascript
222+
msg.payload = {
223+
"assetId": "{assetId}",
224+
"includeShared": false,
225+
"propertyNames": []
226+
};
227+
228+
return msg;
229+
```
230+
231+
You can reduce the number of items in payload by specifying list of properties to include in the message: e.g.
232+
`propertyNames: ["variables"] or ["location"]`
233+
234+
#### Executing custom functions using MindSphere javascript/typescript SDK
235+
236+
The node can be used to execute a complex script which uses [MindSphere javascript/typescript SDK](https://opensource.mindsphere.io/docs/mindconnect-nodejs/sdk/index.html). The node will create an asyncronous function with one parameter (sdk) and the specified function body and execute it. You can only call the MindSphere APIs which allow agent authorization.
237+
238+
```javascript
239+
msg.payload = {
240+
function: `
241+
const assetManagement = sdk.GetAssetManagementClient();
242+
const asset = await assetManagement.GetAsset('{assetId}');
243+
return asset;
244+
`};
245+
246+
return msg;
247+
```
248+
217249
#### Error handling in the flows
218250

219251
The node can be configured to retry all mindsphere operations (1-10 times, with delay of time \* 300ms before the next try)

0 commit comments

Comments
 (0)