diff --git a/content/en/docs/releasenotes/workstation/_index.md b/content/en/docs/releasenotes/workstation/_index.md index b9d065cebce..d04058d68d5 100644 --- a/content/en/docs/releasenotes/workstation/_index.md +++ b/content/en/docs/releasenotes/workstation/_index.md @@ -10,6 +10,46 @@ cascade: These release notes cover changes made to the [Mendix Workstation](/mendix-workstation/). +## 3.6.0 + +### Release date: April ??, 2026 + +### Workstation Management + +#### New Features + +* 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. + +### Workstation Connector + +#### New Features + +* 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. +* 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. +* 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). +* 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. +* New app key-related API - We have added a new `/rest/stationconnector/publickey` API for future improvements to app key configuration. + +### Fixes + +* We have fixed a bug where the connection timeout would not trigger if the devices list was not received. The timeout now uses a shared abort signal. +* We have fixed a bug where devices were not added to the internal device list if they were added at a later time. +* We have fixed a bug where callbacks would fail after the Object arguments were garbage collected. +* We have fixes a bug where it was impossible to connect to new devices. + +### Deprecations + +* We have removed the `Station_User` association. +* We have removed support for named events using strings and string expressions instead of object attributes. +* We have deprecated the following actions: + + * `SendMessage` and `WaitForResponse` - Deprecated in favor of `SendDeviceMessage` and `WaitForDeviceMessage` + * `SubscribeToMessages` (with `subscribeOnce` and implicit connection) - Deprecated in favor of `SubscribeToDeviceMessages`, `Unsubscribe`, and `ConnectDevice` + * `SubscribeToErrors` (with `subscribeOnce` and implicit connection) - Deprecated in favor of `SubscribeToDeviceErrors`, `Unsubscribe`, and `ConnectDevice` + * `UnsubscribeByDevice` and `UnsubscribeByContext` - Deprecated in favor of `Unsubscribe` + + The deprecated actions are longer exposed as nanoflows and have been moved to the `_USE_ME/Deprecated` folder. + ## 3.5.0 ### Release date: March 12, 2026 diff --git a/content/en/docs/workstation/wks-build-app.md b/content/en/docs/workstation/wks-build-app.md index 3f91c086284..c23aa077dae 100644 --- a/content/en/docs/workstation/wks-build-app.md +++ b/content/en/docs/workstation/wks-build-app.md @@ -65,18 +65,7 @@ To change a user's role or remove them from the workspace, click the three-dot i ## Getting Started with Custom Logic for Device Interaction -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 Java actions are essential for establishing connections, sending or receiving messages, and managing device interactions: - -* **GetStation** - Retrieves the computer information connected to the Client. -* **SendMessage** - 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/). -* **SubscribeToMessages** - Subscribes to device messages and triggers a nanoflow when messages are received. -* **SubscribeToErrors** - Subscribes to device connection errors and triggers a nanoflow when errors occur. -* **Unsubscribe** - End the subscription to device messages or errors. -* **UnsubscribeByContext** - End all subscriptions related to a context object. -* **UnsubscribeByDevice** - End all subscriptions related to a specific device. -* **DisconnectDevice** - Unsubscribe and completely disconnect from a specific device. - -These nanoflows and actions serve as the core building blocks for integrating devices into your Mendix applications and tailoring the functionality to your specific requirements. +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. ### Understanding the Domain Model @@ -86,46 +75,104 @@ The domain model contains the following entities: * **Device** - A list of devices associated with the station; includes device names and properties required to achieve a connection (non-persistent entities). * **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. -### Using the Nanoflows and Actions +### Using the Nanoflows and Actions {#java-actions} The following section provides more information about using the nanoflows and Java actions in your Mendix application. -#### GetStation +#### SendDeviceMessage -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. +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: + +* `device` +* `message` + +#### WaitForDeviceMessage + +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: -#### SendMessage +* `device` +* `timeout` -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. +#### WaitForObjectChange -#### SubscribeToMessages +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: -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. +* `objectToObserve` +* `attributes` +* `timeout` -The callback nanoflow must have the following parameters: +#### SubscribeToObjectChanges -* `Device` (object) -* `Message` (String) -* `Context object` (same as the name used when subscribing) +Call `SubscribeToObjectChanges` to trigger a nanoflow when the specified object changes. This action has the following parameters: -#### SubscribeToErrors +* `objectToObserve` +* `attributes` +* `callback` +* `applicationContext` -Call `SubscribeToErrors` to trigger a nanoflow on device connection error. +#### SubscribeToDeviceMessages -The callback nanoflow must have the following parameters: +Call `SubscribeToDeviceMessages` to trigger a nanoflow when a message is received from a device. This action has the following parameters: -* `Device` (object) -* `ErrorMessage` (String) -* `ErrorCode` (Integer) -* `Context object` (same as the name used when subscribing) +* `device` +* `callback` +* `applicationContext` + +#### SubscribeToDeviceErrors + +Call `SubscribeToDeviceErrors` to trigger a nanoflow on device connection error. This action has the following parameters: + +* `device` +* `callback` +* `applicationContext` #### Unsubscribe Call `Unsubscribe` to end a subscription. -#### UnsubscribeByContext +#### SetupDevice + +Call this nanoflow to create and configure a device, and define the actions that should happen on connection, disconnection, or messages from the device. This action has the following parameters: + +* `name` +* `class` +* `initialize` +* `createDevice` +* `entity` +* `onConnect` +* `onMessage` +* `onDisconnect` + +#### ConnectDevice + +Call this action to connect to a specific device. + +#### DisconnectDevice + +Call this action to unsubscribe and completely disconnect from a specific device. + +#### Initialize + +Call this action to initialize a peripheral module without creating a station or device. + +#### GetStation + +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. + +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`. + +#### Private Nanoflows + +`CreateStation`, `CommitStation`, `CreateDevice`, and `CommitDevice` are private nanoflows, required be compatible with [strict mode](/refguide/strict-mode/). + +### Widgets {#widgets} + +The following widgets allow you to specify when to execute an action: -Call `UnsubscribeByContext` to end all subscriptions related to a context object. +* **On Load/Unload** - Execute the action when the widget is first rendered, or when it is removed (unloaded). +* **On Change** - Execute the action when the specified attribute changes. +* **On Equal** - Execute the action when an attribute is equal to the specified expression. +* **On True** - Execute the action when the specified expression is true. ## Error Logs diff --git a/content/en/docs/workstation/wks-message-syntax.md b/content/en/docs/workstation/wks-message-syntax.md index 037436e5b88..e562a594f07 100644 --- a/content/en/docs/workstation/wks-message-syntax.md +++ b/content/en/docs/workstation/wks-message-syntax.md @@ -65,7 +65,7 @@ The section below shows a sample test that you can run to verify the configurati * **Allow writing files** - **Yes** * Use the default values for everything else 4. Register the Station to your computer (assuming the Workstation Client is installed there). -5. In your Workspace, navigate to **Test Your Station** and click on the configured file device. +5. In your Workspace, navigate to **Test Your Station** and click **Test** by the configured file device. 6. Enter `3#test.txt#Hello from Mendix` in the **Send Message** field, and then press **Send Message**. The test should show a response like `S#3#C:\MyTestFolder\test.txt` to indicate that the text file *test.txt* was successfully written to *MyTestFolder*.