You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/releasenotes/workstation/_index.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,14 +20,15 @@ These release notes cover changes made to the [Mendix Workstation](/mendix-works
20
20
21
21
* Testing improvements - We have enhanced the **Test Your Station** page by making it simpler to send messages to devices without enforcing strict validations. In addition, the page now displays the connection status for each device, as well as the last recorded error, if any.
22
22
23
-
### Workstation Client
23
+
### Workstation Connector
24
24
25
25
#### New Features
26
26
27
-
* New app key-related API - We have added a new `/rest/stationconnector/publickey` API for future improvements to app key configuration.
28
-
* New API for reusable modules - We have created a new high-level `SetupDevice` API to make the creation of reusable peripheral modules easier. The new API does not require the use of any subscription-related APIs.
27
+
* New API for reusable modules - We have created a new high-level `SetupDevice` API to simplify the creation of custom, reusable peripheral modules for your organization. The new API does not require the use of any subscription-related APIs.
29
28
* Better organization for subscription-related actions - We have moved the subscription-related Java actions to the `_USE_ME/Subscriptions` in order to provide more clarity for the user.
30
29
* New nanoflows, Java actions, and widgets - We have added a number of other new nanoflows, Java actions, and widgets that you can use to configure the behaviour of your application. For more information, see [Nanoflows](/mendix-workstation/build-app/#java-actions) and [Widgets](/mendix-workstation/build-app/#widgets).
30
+
* Strict mode compatibility - We have changed certain APIs used by the Workstation Connector, so that it is now compatible with [strict mode](/refguide/strict-mode/), increasing the security. Previously, the connector used some APIs that were restricted in strict mode.
31
+
* New app key-related API - We have added a new `/rest/stationconnector/publickey` API for future improvements to app key configuration.
Copy file name to clipboardExpand all lines: content/en/docs/workstation/wks-build-app.md
+78-48Lines changed: 78 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,34 +67,6 @@ To change a user's role or remove them from the workspace, click the three-dot i
67
67
68
68
Now that you are ready to start using Mendix Workstation, you can implement your own custom logic for interacting with devices. The following nanoflows and actions serve as the core building blocks for integrating devices into your Mendix applications and tailoring the functionality to your specific requirements.
69
69
70
-
### Nanoflows {#java-actions}
71
-
72
-
The following nanoflows and Java actions are essential for establishing connections, sending or receiving messages, and managing device interactions:
73
-
74
-
***GetStation** - Retrieves the computer information connected to the Client.
75
-
***SendDeviceMessage** - Sends data or commands to the connected device. For more information about the supported message syntax, see [Message Syntax for File, Smart Card, and Bluetooth Devices](/mendix-workstation/device-syntax/).
76
-
***WaitForDeviceMessage** - Waits for a message from the connected device for the duration of the specified timeout period.
77
-
***WaitForObjectChange** - Waits for changes in the specified object for the duration of the specified timeout period.
78
-
***SubscribeToDeviceMessages** - Subscribes to device messages and triggers a nanoflow when messages are received.
79
-
***SubscribeToDeviceErrors** - Subscribes to device connection errors and triggers a nanoflow when errors occur.
80
-
***SubscribeToObjectChanges** - Subscribes to changes in the specified object.
81
-
***Unsubscribe** - Ends the subscription to device messages or errors.
82
-
***SetupDevice** - Creates and configures a device with the specified parameters.
83
-
***ConnectDevice** - Connects to a specific device.
84
-
***DisconnectDevice** - Unsubscribes and completely disconnects from a specific device.
85
-
***Initialize** - Initializes the Client without creating a station or device.
86
-
***GetStation** - Retrieves the Station object.
87
-
***CreateStation**, **CommitStation**, **CreateDevice**, **CommitDevice** - Internal nanoflows, required to support the React strict mode.
88
-
89
-
### Widgets {#widgets}
90
-
91
-
The following widgets allow you to specify when to execute an action:
92
-
93
-
***On Load/Unload** - Execute the action when the widget is first rendered, or when it is removed (unloaded).
94
-
***On Change** - Execute the action when the specified attribute changes.
95
-
***On Equal** - Execute the action when an attribute is equal to the specified expression.
96
-
***On True** - Execute the action when the specified expression is true.
97
-
98
70
### Understanding the Domain Model
99
71
100
72
The domain model contains the following entities:
@@ -103,46 +75,104 @@ The domain model contains the following entities:
103
75
***Device** - A list of devices associated with the station; includes device names and properties required to achieve a connection (non-persistent entities).
104
76
***AppKeyPair** - A persistent entity to store the app's key pair. The public key needs to be entered in the corresponding app in the Workstation Management.
105
77
106
-
### Using the Nanoflows and Actions
78
+
### Using the Nanoflows and Actions {#java-actions}
107
79
108
80
The following section provides more information about using the nanoflows and Java actions in your Mendix application.
109
81
110
-
#### GetStation
82
+
#### SendDeviceMessage
111
83
112
-
Call `GetStation` to retrieve configuration of the current Client computer by using the Workstation Client. `GetStation` can be used multiple times, but it queries the Workstation Client only the first time. The following calls return the current object loaded in the session. If connection with Workstation Client does not work, `GetStation` returns an empty object.
84
+
Call `SendDeviceMessage` to send a message to a device. For more information about the supported message syntax, see [Message Syntax for File, Smart Card, and Bluetooth Devices](/mendix-workstation/device-syntax/). This action has the following parameters:
85
+
86
+
*`device`
87
+
*`message`
88
+
89
+
#### WaitForDeviceMessage
90
+
91
+
Call `WaitForDeviceMessage` to wait for a message from the connected device for the duration of the specified timeout period. This action has the following parameters:
92
+
93
+
*`device`
94
+
*`timeout`
113
95
114
-
#### SendMessage
96
+
#### WaitForObjectChange
115
97
116
-
Call `SendMessage` to send a message to a device. `SendMessage` includes the option to wait for the response of the device in the current nanoflow.
98
+
Call `WaitForObjectChange` to wait for changes in the attributes of the specified object for the duration of the specified timeout period. This action has the following parameters:
117
99
118
-
#### SubscribeToMessages
100
+
*`objectToObserve`
101
+
*`attributes`
102
+
*`timeout`
119
103
120
-
Call `SubscribeToMessages` to trigger a nanoflow when a message is received from a device. `SubscribeToMessages` provides an option to specify a context object that will be passed to the callback nanoflow whenever a message is received.
104
+
#### SubscribeToObjectChanges
121
105
122
-
The callback nanoflow must have the following parameters:
106
+
Call `SubscribeToObjectChanges` to trigger a nanoflow when the specified object changes. This action has the following parameters:
123
107
124
-
*`Device` (object)
125
-
*`Message` (String)
126
-
*`Context object` (same as the name used when subscribing)
108
+
*`objectToObserve`
109
+
*`attributes`
110
+
*`callback`
111
+
*`applicationContext`
127
112
128
-
#### SubscribeToErrors
113
+
#### SubscribeToDeviceMessages
129
114
130
-
Call `SubscribeToErrors` to trigger a nanoflow on device connection error.
115
+
Call `SubscribeToDeviceMessages` to trigger a nanoflow when a message is received from a device. This action has the following parameters:
131
116
132
-
The callback nanoflow must have the following parameters:
117
+
*`device`
118
+
*`callback`
119
+
*`applicationContext`
133
120
134
-
*`Device` (object)
135
-
*`ErrorMessage` (String)
136
-
*`ErrorCode` (Integer)
137
-
*`Context object` (same as the name used when subscribing)
121
+
#### SubscribeToDeviceErrors
122
+
123
+
Call `SubscribeToDeviceErrors` to trigger a nanoflow on device connection error. This action has the following parameters:
124
+
125
+
*`device`
126
+
*`callback`
127
+
*`applicationContext`
138
128
139
129
#### Unsubscribe
140
130
141
131
Call `Unsubscribe` to end a subscription.
142
132
143
-
#### UnsubscribeByContext
133
+
#### SetupDevice
134
+
135
+
Call this nanoflow to create and configures a device with the specified parameters. This action has the following parameters:
136
+
137
+
*`name`
138
+
*`class`
139
+
*`initialize`
140
+
*`createDevice`
141
+
*`entity`
142
+
*`onConnect`
143
+
*`onMessage`
144
+
*`onDisconnect`
145
+
146
+
#### ConnectDevice
144
147
145
-
Call `UnsubscribeByContext` to end all subscriptions related to a context object.
148
+
Call this action to connect to a specific device.
149
+
150
+
#### DisconnectDevice
151
+
152
+
Call this action to unsubscribe and completely disconnect from a specific device.
153
+
154
+
#### Initialize
155
+
156
+
Call this action to initialize a peripheral module without creating a station or device.
157
+
158
+
#### GetStation
159
+
160
+
Call `GetStation` to retrieve configuration of the current Client computer by using the Workstation Client. `GetStation` can be used multiple times, but it queries the Workstation Client only the first time. The following calls return the current object loaded in the session. If connection with Workstation Client does not work, `GetStation` returns an empty object.
161
+
162
+
If your microflow references a peripheral module (that is, a reusable module which supports a specific peripheral device), you do not need to call `GetStation` to reference it. Instead, you can initialize the peripheral module by calling `Initialize`.
163
+
164
+
#### Private Nanoflows
165
+
166
+
`CreateStation`, `CommitStation`, `CreateDevice`, and `CommitDevice` are private nanoflows, required be compatible with [strict mode](/refguide/strict-mode/).
167
+
168
+
### Widgets {#widgets}
169
+
170
+
The following widgets allow you to specify when to execute an action:
171
+
172
+
***On Load/Unload** - Execute the action when the widget is first rendered, or when it is removed (unloaded).
173
+
***On Change** - Execute the action when the specified attribute changes.
174
+
***On Equal** - Execute the action when an attribute is equal to the specified expression.
175
+
***On True** - Execute the action when the specified expression is true.
0 commit comments