Skip to content

Commit 8444972

Browse files
updates
1 parent 3874da2 commit 8444972

2 files changed

Lines changed: 125 additions & 118 deletions

File tree

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
---
2+
title: "Developing Workstation-Enabled Applications"
3+
url: /mendix-workstation/build-app/
4+
description: "Describes the key concepts and best practices to consider when building an app to work with Mendix Workstation."
5+
weight: 25
6+
---
7+
8+
## Introduction
9+
10+
11+
## Getting Started with Custom Logic for Device Interaction
12+
13+
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.
14+
15+
### Understanding the Domain Model
16+
17+
The domain model contains the following entities:
18+
19+
* **Station** - A non-persistent entity representing the Workstation Client configuration.
20+
* **Device** - A non-persistent entity representing a connectable peripheral device. Includes the name, class and state (Available, Connected, or Error). Specialize this to maintain your device specific state.
21+
* **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.
22+
23+
### Using the Nanoflows and Actions {#javascript-actions}
24+
25+
The following section provides more information about using the nanoflows and Java actions in your Mendix application.
26+
27+
#### SendDeviceMessage
28+
29+
Call `SendDeviceMessage` to send a message to a device. For more information about the supported message syntax, see [Configuring Devices](/mendix-workstation/management-devices/). This action has the following parameters:
30+
31+
* `device`
32+
* `message`
33+
34+
#### WaitForDeviceMessage
35+
36+
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:
37+
38+
* `device`
39+
* `timeout`
40+
41+
#### WaitForObjectChange
42+
43+
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:
44+
45+
* `objectToObserve`
46+
* `attributes`
47+
* `timeout`
48+
49+
#### GetCreateDevice
50+
51+
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:
52+
53+
* `name`
54+
* `class`
55+
* `initialize`
56+
* `createDevice`
57+
* `entity`
58+
* `onConnect`
59+
* `onMessage`
60+
* `onDisconnect`
61+
62+
#### ConnectDevice
63+
64+
Call this action to connect to a specific device.
65+
66+
#### DisconnectDevice
67+
68+
Call this action to disconnect from a specific device.
69+
70+
#### Initialize
71+
72+
This action sets up communication with the Workstation Client. It should be automatically called through the `initialize` parameter of `GetStation` or `GetCreateDevice`.
73+
74+
#### GetStation
75+
76+
Call `GetStation` to retrieve the current Workstation Client configuration and devices. This action creates and returns a station object with a linked device object per peripheral.
77+
78+
To interact with a specific device, it is better to use `GetCreateDevice` instead. `GetCreateDevice` has a more convenient API, allows specialization, and does not create station and device objects which may not be needed.
79+
80+
#### SubscribeToObjectChanges
81+
82+
Call `SubscribeToObjectChanges` to trigger a nanoflow when the specified object changes. This action has the following parameters:
83+
84+
* `objectToObserve`
85+
* `attributes`
86+
* `callback`
87+
* `applicationContext`
88+
89+
#### SubscribeToDeviceMessages
90+
91+
Call `SubscribeToDeviceMessages` to trigger a nanoflow when a message is received from a device. This action has the following parameters:
92+
93+
* `device`
94+
* `callback`
95+
* `applicationContext`
96+
97+
#### SubscribeToDeviceErrors
98+
99+
Call `SubscribeToDeviceErrors` to trigger a nanoflow on device connection error. This action has the following parameters:
100+
101+
* `device`
102+
* `callback`
103+
* `applicationContext`
104+
105+
#### Unsubscribe
106+
107+
Call `Unsubscribe` to end a subscription.
108+
109+
#### Private Nanoflows
110+
111+
`CreateStation`, `CommitStation`, `CreateDevice`, and `CommitDevice` are private nanoflows, required be compatible with [strict mode](/refguide/strict-mode/).
112+
113+
### Widgets {#widgets}
114+
115+
The following widgets allow you to specify when to execute an action:
116+
117+
* **On Load/Unload** - Execute the action when the widget is first rendered, or when it is removed (unloaded).
118+
* **On Change** - Execute the action when the specified attribute changes.
119+
* **On Equal** - Execute the action when an attribute is equal to the specified expression.
120+
* **On True** - Execute the action when the specified expression is true.
121+
122+
## Error Logs
123+
124+
Logs for the Workstation Management, Client, and Connector are available in case of issues. For more information about accessing the logs, see [Troubleshooting Mendix Workstation](/mendix-workstation/troubleshooting/).

content/en/docs/workstation/connector/wks-connector.md renamed to content/en/docs/workstation/connector/wks-connector-install.md

Lines changed: 1 addition & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
title: "Installing the Workstation Connector"
33
url: /mendix-workstation/install-connector/
44
description: "Describes how to install the Workstation Connector and build an app to work with Mendix Workstation."
5-
aliases:
6-
- /mendix-workstation/build-app/
75
weight: 20
86
---
97

@@ -62,119 +60,4 @@ You can invite other Workstation Management users to your workspace to share con
6260

6361
To invite a user, click **Team** in the left navigation menu, then click **Invite Team Member**. Enter the user's email address and select a role. For more information about the available roles, see [Managing the Team](/mendix-workstation/management-team/).
6462

65-
To change a user's role or remove them from the workspace, click the three-dot icon in the right column of the user list. This action requires the Owner or Workspace Admin role.
66-
67-
## Getting Started with Custom Logic for Device Interaction
68-
69-
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.
70-
71-
### Understanding the Domain Model
72-
73-
The domain model contains the following entities:
74-
75-
* **Station** - A non-persistent entity representing the Workstation Client configuration.
76-
* **Device** - A non-persistent entity representing a connectable peripheral device. Includes the name, class and state (Available, Connected, or Error). Specialize this to maintain your device specific state.
77-
* **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.
78-
79-
### Using the Nanoflows and Actions {#javascript-actions}
80-
81-
The following section provides more information about using the nanoflows and Java actions in your Mendix application.
82-
83-
#### SendDeviceMessage
84-
85-
Call `SendDeviceMessage` to send a message to a device. For more information about the supported message syntax, see [Configuring Devices](/mendix-workstation/management-devices/). This action has the following parameters:
86-
87-
* `device`
88-
* `message`
89-
90-
#### WaitForDeviceMessage
91-
92-
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:
93-
94-
* `device`
95-
* `timeout`
96-
97-
#### WaitForObjectChange
98-
99-
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:
100-
101-
* `objectToObserve`
102-
* `attributes`
103-
* `timeout`
104-
105-
#### GetCreateDevice
106-
107-
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:
108-
109-
* `name`
110-
* `class`
111-
* `initialize`
112-
* `createDevice`
113-
* `entity`
114-
* `onConnect`
115-
* `onMessage`
116-
* `onDisconnect`
117-
118-
#### ConnectDevice
119-
120-
Call this action to connect to a specific device.
121-
122-
#### DisconnectDevice
123-
124-
Call this action to disconnect from a specific device.
125-
126-
#### Initialize
127-
128-
This action sets up communication with the Workstation Client. It should be automatically called through the `initialize` parameter of `GetStation` or `GetCreateDevice`.
129-
130-
#### GetStation
131-
132-
Call `GetStation` to retrieve the current Workstation Client configuration and devices. This action creates and returns a station object with a linked device object per peripheral.
133-
134-
To interact with a specific device, it is better to use `GetCreateDevice` instead. `GetCreateDevice` has a more convenient API, allows specialization, and does not create station and device objects which may not be needed.
135-
136-
#### SubscribeToObjectChanges
137-
138-
Call `SubscribeToObjectChanges` to trigger a nanoflow when the specified object changes. This action has the following parameters:
139-
140-
* `objectToObserve`
141-
* `attributes`
142-
* `callback`
143-
* `applicationContext`
144-
145-
#### SubscribeToDeviceMessages
146-
147-
Call `SubscribeToDeviceMessages` to trigger a nanoflow when a message is received from a device. This action has the following parameters:
148-
149-
* `device`
150-
* `callback`
151-
* `applicationContext`
152-
153-
#### SubscribeToDeviceErrors
154-
155-
Call `SubscribeToDeviceErrors` to trigger a nanoflow on device connection error. This action has the following parameters:
156-
157-
* `device`
158-
* `callback`
159-
* `applicationContext`
160-
161-
#### Unsubscribe
162-
163-
Call `Unsubscribe` to end a subscription.
164-
165-
#### Private Nanoflows
166-
167-
`CreateStation`, `CommitStation`, `CreateDevice`, and `CommitDevice` are private nanoflows, required be compatible with [strict mode](/refguide/strict-mode/).
168-
169-
### Widgets {#widgets}
170-
171-
The following widgets allow you to specify when to execute an action:
172-
173-
* **On Load/Unload** - Execute the action when the widget is first rendered, or when it is removed (unloaded).
174-
* **On Change** - Execute the action when the specified attribute changes.
175-
* **On Equal** - Execute the action when an attribute is equal to the specified expression.
176-
* **On True** - Execute the action when the specified expression is true.
177-
178-
## Error Logs
179-
180-
Logs for the Workstation Management, Client, and Connector are available in case of issues. For more information about accessing the logs, see [Troubleshooting Mendix Workstation](/mendix-workstation/troubleshooting/).
63+
To change a user's role or remove them from the workspace, click the three-dot icon in the right column of the user list. This action requires the Owner or Workspace Admin role.

0 commit comments

Comments
 (0)