@5minds/processcube_engine_client 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc.json +5 -0
- package/LICENSE +21 -0
- package/README.md +283 -0
- package/dist/Client.d.ts +44 -0
- package/dist/ClientFactory.d.ts +21 -0
- package/dist/Clients/AnonymousSessionHttpClient.d.ts +7 -0
- package/dist/Clients/ApplicationInfoHttpClient.d.ts +10 -0
- package/dist/Clients/BaseClient.d.ts +26 -0
- package/dist/Clients/CorrelationHttpClient.d.ts +15 -0
- package/dist/Clients/CronjobHttpClient.d.ts +29 -0
- package/dist/Clients/DataObjectInstanceHttpClient.d.ts +10 -0
- package/dist/Clients/EmptyActivityHttpClient.d.ts +22 -0
- package/dist/Clients/EventHttpClient.d.ts +55 -0
- package/dist/Clients/ExternalTaskApiHttpClient.d.ts +19 -0
- package/dist/Clients/ExternalTaskHttpClient.d.ts +12 -0
- package/dist/Clients/FlowNodeInstanceHttpClient.d.ts +23 -0
- package/dist/Clients/Lib/Mappers.d.ts +20 -0
- package/dist/Clients/Lib/SocketIoManager.d.ts +36 -0
- package/dist/Clients/ManualTaskHttpClient.d.ts +22 -0
- package/dist/Clients/NotificationHttpClient.d.ts +178 -0
- package/dist/Clients/ProcessDefinitionHttpClient.d.ts +31 -0
- package/dist/Clients/ProcessDefinitionHttpClientNode.d.ts +8 -0
- package/dist/Clients/ProcessInstanceHttpClient.d.ts +23 -0
- package/dist/Clients/ProcessModelHttpClient.d.ts +29 -0
- package/dist/Clients/UserMetadataStorageHttpClient.d.ts +22 -0
- package/dist/Clients/UserTaskHttpClient.d.ts +32 -0
- package/dist/Clients/index.d.ts +18 -0
- package/dist/ExternalTaskWorker.d.ts +32 -0
- package/dist/HttpClient.d.ts +26 -0
- package/dist/Types/CallbackTypes.d.ts +39 -0
- package/dist/Types/IExternalTaskWorker.d.ts +34 -0
- package/dist/Types/RestSettings.d.ts +674 -0
- package/dist/Types/SocketSettings.d.ts +59 -0
- package/dist/Types/index.d.ts +15 -0
- package/dist/amd/Client.js +104 -0
- package/dist/amd/Client.js.map +1 -0
- package/dist/amd/ClientFactory.js +56 -0
- package/dist/amd/ClientFactory.js.map +1 -0
- package/dist/amd/Clients/AnonymousSessionHttpClient.js +29 -0
- package/dist/amd/Clients/AnonymousSessionHttpClient.js.map +1 -0
- package/dist/amd/Clients/ApplicationInfoHttpClient.js +30 -0
- package/dist/amd/Clients/ApplicationInfoHttpClient.js.map +1 -0
- package/dist/amd/Clients/BaseClient.js +128 -0
- package/dist/amd/Clients/BaseClient.js.map +1 -0
- package/dist/amd/Clients/CorrelationHttpClient.js +29 -0
- package/dist/amd/Clients/CorrelationHttpClient.js.map +1 -0
- package/dist/amd/Clients/CronjobHttpClient.js +55 -0
- package/dist/amd/Clients/CronjobHttpClient.js.map +1 -0
- package/dist/amd/Clients/DataObjectInstanceHttpClient.js +19 -0
- package/dist/amd/Clients/DataObjectInstanceHttpClient.js.map +1 -0
- package/dist/amd/Clients/EmptyActivityHttpClient.js +38 -0
- package/dist/amd/Clients/EmptyActivityHttpClient.js.map +1 -0
- package/dist/amd/Clients/EventHttpClient.js +68 -0
- package/dist/amd/Clients/EventHttpClient.js.map +1 -0
- package/dist/amd/Clients/ExternalTaskApiHttpClient.js +86 -0
- package/dist/amd/Clients/ExternalTaskApiHttpClient.js.map +1 -0
- package/dist/amd/Clients/ExternalTaskHttpClient.js +27 -0
- package/dist/amd/Clients/ExternalTaskHttpClient.js.map +1 -0
- package/dist/amd/Clients/FlowNodeInstanceHttpClient.js +55 -0
- package/dist/amd/Clients/FlowNodeInstanceHttpClient.js.map +1 -0
- package/dist/amd/Clients/Lib/Mappers.js +290 -0
- package/dist/amd/Clients/Lib/Mappers.js.map +1 -0
- package/dist/amd/Clients/Lib/SocketIoManager.js +114 -0
- package/dist/amd/Clients/Lib/SocketIoManager.js.map +1 -0
- package/dist/amd/Clients/ManualTaskHttpClient.js +38 -0
- package/dist/amd/Clients/ManualTaskHttpClient.js.map +1 -0
- package/dist/amd/Clients/NotificationHttpClient.js +144 -0
- package/dist/amd/Clients/NotificationHttpClient.js.map +1 -0
- package/dist/amd/Clients/ProcessDefinitionHttpClient.js +92 -0
- package/dist/amd/Clients/ProcessDefinitionHttpClient.js.map +1 -0
- package/dist/amd/Clients/ProcessDefinitionHttpClientNode.js +25 -0
- package/dist/amd/Clients/ProcessDefinitionHttpClientNode.js.map +1 -0
- package/dist/amd/Clients/ProcessInstanceHttpClient.js +91 -0
- package/dist/amd/Clients/ProcessInstanceHttpClient.js.map +1 -0
- package/dist/amd/Clients/ProcessModelHttpClient.js +93 -0
- package/dist/amd/Clients/ProcessModelHttpClient.js.map +1 -0
- package/dist/amd/Clients/UserMetadataStorageHttpClient.js +42 -0
- package/dist/amd/Clients/UserMetadataStorageHttpClient.js.map +1 -0
- package/dist/amd/Clients/UserTaskHttpClient.js +56 -0
- package/dist/amd/Clients/UserTaskHttpClient.js.map +1 -0
- package/dist/amd/Clients/index.js +37 -0
- package/dist/amd/Clients/index.js.map +1 -0
- package/dist/amd/ExternalTaskWorker.js +141 -0
- package/dist/amd/ExternalTaskWorker.js.map +1 -0
- package/dist/amd/HttpClient.js +124 -0
- package/dist/amd/HttpClient.js.map +1 -0
- package/dist/amd/Types/CallbackTypes.js +5 -0
- package/dist/amd/Types/CallbackTypes.js.map +1 -0
- package/dist/amd/Types/IExternalTaskWorker.js +5 -0
- package/dist/amd/Types/IExternalTaskWorker.js.map +1 -0
- package/dist/amd/Types/RestSettings.js +709 -0
- package/dist/amd/Types/RestSettings.js.map +1 -0
- package/dist/amd/Types/SocketSettings.js +70 -0
- package/dist/amd/Types/SocketSettings.js.map +1 -0
- package/dist/amd/Types/index.js +30 -0
- package/dist/amd/Types/index.js.map +1 -0
- package/dist/amd/index.js +29 -0
- package/dist/amd/index.js.map +1 -0
- package/dist/commonjs/Client.js +104 -0
- package/dist/commonjs/Client.js.map +1 -0
- package/dist/commonjs/ClientFactory.js +56 -0
- package/dist/commonjs/ClientFactory.js.map +1 -0
- package/dist/commonjs/Clients/AnonymousSessionHttpClient.js +30 -0
- package/dist/commonjs/Clients/AnonymousSessionHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/ApplicationInfoHttpClient.js +30 -0
- package/dist/commonjs/Clients/ApplicationInfoHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/BaseClient.js +128 -0
- package/dist/commonjs/Clients/BaseClient.js.map +1 -0
- package/dist/commonjs/Clients/CorrelationHttpClient.js +29 -0
- package/dist/commonjs/Clients/CorrelationHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/CronjobHttpClient.js +56 -0
- package/dist/commonjs/Clients/CronjobHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/DataObjectInstanceHttpClient.js +20 -0
- package/dist/commonjs/Clients/DataObjectInstanceHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/EmptyActivityHttpClient.js +40 -0
- package/dist/commonjs/Clients/EmptyActivityHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/EventHttpClient.js +70 -0
- package/dist/commonjs/Clients/EventHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/ExternalTaskApiHttpClient.js +87 -0
- package/dist/commonjs/Clients/ExternalTaskApiHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/ExternalTaskHttpClient.js +26 -0
- package/dist/commonjs/Clients/ExternalTaskHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/FlowNodeInstanceHttpClient.js +56 -0
- package/dist/commonjs/Clients/FlowNodeInstanceHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/Lib/Mappers.js +289 -0
- package/dist/commonjs/Clients/Lib/Mappers.js.map +1 -0
- package/dist/commonjs/Clients/Lib/SocketIoManager.js +116 -0
- package/dist/commonjs/Clients/Lib/SocketIoManager.js.map +1 -0
- package/dist/commonjs/Clients/ManualTaskHttpClient.js +40 -0
- package/dist/commonjs/Clients/ManualTaskHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/NotificationHttpClient.js +144 -0
- package/dist/commonjs/Clients/NotificationHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/ProcessDefinitionHttpClient.js +94 -0
- package/dist/commonjs/Clients/ProcessDefinitionHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/ProcessDefinitionHttpClientNode.js +25 -0
- package/dist/commonjs/Clients/ProcessDefinitionHttpClientNode.js.map +1 -0
- package/dist/commonjs/Clients/ProcessInstanceHttpClient.js +93 -0
- package/dist/commonjs/Clients/ProcessInstanceHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/ProcessModelHttpClient.js +95 -0
- package/dist/commonjs/Clients/ProcessModelHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/UserMetadataStorageHttpClient.js +42 -0
- package/dist/commonjs/Clients/UserMetadataStorageHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/UserTaskHttpClient.js +58 -0
- package/dist/commonjs/Clients/UserTaskHttpClient.js.map +1 -0
- package/dist/commonjs/Clients/index.js +35 -0
- package/dist/commonjs/Clients/index.js.map +1 -0
- package/dist/commonjs/ExternalTaskWorker.js +142 -0
- package/dist/commonjs/ExternalTaskWorker.js.map +1 -0
- package/dist/commonjs/HttpClient.js +124 -0
- package/dist/commonjs/HttpClient.js.map +1 -0
- package/dist/commonjs/Types/CallbackTypes.js +3 -0
- package/dist/commonjs/Types/CallbackTypes.js.map +1 -0
- package/dist/commonjs/Types/IExternalTaskWorker.js +3 -0
- package/dist/commonjs/Types/IExternalTaskWorker.js.map +1 -0
- package/dist/commonjs/Types/RestSettings.js +707 -0
- package/dist/commonjs/Types/RestSettings.js.map +1 -0
- package/dist/commonjs/Types/SocketSettings.js +68 -0
- package/dist/commonjs/Types/SocketSettings.js.map +1 -0
- package/dist/commonjs/Types/index.js +30 -0
- package/dist/commonjs/Types/index.js.map +1 -0
- package/dist/commonjs/index.js +28 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/package.json +43 -0
package/.prettierrc.json
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019-2023 https://processcube.5minds.de/
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
# Engine Client.ts
|
|
2
|
+
|
|
3
|
+
A client for communicating with the `Engine`.
|
|
4
|
+
|
|
5
|
+
It is written in TypeScript and implemented in NodeJS.
|
|
6
|
+
|
|
7
|
+
## Quick example
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import {EngineClient} from '@5minds/processcube_engine_client';
|
|
11
|
+
|
|
12
|
+
const engineUri = 'http://localhost:10560';
|
|
13
|
+
|
|
14
|
+
async function run() {
|
|
15
|
+
const client = new EngineClient(engineUri);
|
|
16
|
+
|
|
17
|
+
const processInstances = await client.processInstances.query({});
|
|
18
|
+
|
|
19
|
+
console.log(processInstances);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
run();
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## How to use the client
|
|
26
|
+
|
|
27
|
+
You only need to provide an url to the `Engine` you want to access.
|
|
28
|
+
After that, the client is ready to use.
|
|
29
|
+
|
|
30
|
+
You can either create a single EngineClient, which exposes references to all other clients,
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import {EngineClient} from '@5minds/processcube_engine_client';
|
|
34
|
+
|
|
35
|
+
const engineUri = 'http://localhost:10560';
|
|
36
|
+
|
|
37
|
+
async function run() {
|
|
38
|
+
const client = new EngineClient(engineUri);
|
|
39
|
+
|
|
40
|
+
const processInstances = await client.processInstances.query({}, null, 0, 100);
|
|
41
|
+
|
|
42
|
+
console.log(processInstances);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
run();
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
or create multiple specific clients with the ClientFactory:
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
import {ClientFactory} from '@5minds/processcube_engine_client';
|
|
52
|
+
|
|
53
|
+
const engineUri = 'http://localhost:10560';
|
|
54
|
+
|
|
55
|
+
async function run() {
|
|
56
|
+
const processInstanceClient = ClientFactory.createProcessInstanceClient(engineUri);
|
|
57
|
+
|
|
58
|
+
const processInstances = await processInstanceClient.query({}, null, 0, 100);
|
|
59
|
+
|
|
60
|
+
console.log(processInstances);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
run();
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Starting Process Instances
|
|
67
|
+
|
|
68
|
+
You can start new Process Instances through `processDefinitionsClient.startProcessInstance(parameters)` -
|
|
69
|
+
Resolves right after the Process Instance was started
|
|
70
|
+
|
|
71
|
+
Where `parameters` is an object that collects all startup parameters.
|
|
72
|
+
|
|
73
|
+
The following parameters are required:
|
|
74
|
+
- `processModelId`: The ID of the Process Model to execute
|
|
75
|
+
- `startEventId`: The ID of the Start Event by which to start the Process Model. Optional, if the Process Model only has one Start Event.
|
|
76
|
+
|
|
77
|
+
In addition, the following optional parameters are available:
|
|
78
|
+
- `correlationId`: The ID of the correlation to which this Process Instance belongs. If not provided, it will be auto-generated
|
|
79
|
+
- `initialToken`: The initial process token with which to start the Process Instance
|
|
80
|
+
- `parentProcessInstanceId`: When the Process Instance is supposed to be the Subprocess of another Process Instance,
|
|
81
|
+
this contains the ID of the parent Process Instance
|
|
82
|
+
|
|
83
|
+
or through
|
|
84
|
+
|
|
85
|
+
`processDefinitionsClient.startProcessInstanceAndAwaitEndEvent(parameters)` -
|
|
86
|
+
Resolves when the Process Instance has finished with any End Event
|
|
87
|
+
|
|
88
|
+
or through
|
|
89
|
+
|
|
90
|
+
`processDefinitionsClient.startProcessInstanceAndAwaitSpecificEndEvent(parameters, endEventId)` -
|
|
91
|
+
Resolves after the ProcessInstance has reached a specific End Event
|
|
92
|
+
and has additionally the required endEventId parameter:
|
|
93
|
+
- `endEventId`: The ID of the End Event to wait for
|
|
94
|
+
|
|
95
|
+
Examples:
|
|
96
|
+
|
|
97
|
+
#### Start Process Instance and wait for it to start
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import {EngineClient} from '@5minds/processcube_engine_client';
|
|
101
|
+
|
|
102
|
+
const engineUri = 'http://localhost:10560';
|
|
103
|
+
|
|
104
|
+
async function run() {
|
|
105
|
+
const client = new EngineClient(engineUri);
|
|
106
|
+
|
|
107
|
+
await client.processDefinitions.startProcessInstance({processModelId: 'myProcessModelId'});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
run();
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### Start Process Instance and wait for it to finish
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
import {EngineClient} from '@5minds/processcube_engine_client';
|
|
117
|
+
|
|
118
|
+
const engineUri = 'http://localhost:10560';
|
|
119
|
+
|
|
120
|
+
async function run() {
|
|
121
|
+
const client = new EngineClient(engineUri);
|
|
122
|
+
|
|
123
|
+
await client.processDefinitions.startProcessInstanceAndAwaitEndEvent({processModelId: 'myProcessModelId'});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
run();
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### Start Process Instance and wait for an End Event
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
import {EngineClient} from '@5minds/processcube_engine_client';
|
|
133
|
+
|
|
134
|
+
const engineUri = 'http://localhost:10560';
|
|
135
|
+
|
|
136
|
+
async function run() {
|
|
137
|
+
const client = new EngineClient(engineUri);
|
|
138
|
+
|
|
139
|
+
await client.processDefinitions.startProcessInstanceAndAwaitSpecificEndEvent({processModelId: 'myProcessModelId'}, 'My_End_Event_1');
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
run();
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
#### Start Process Instance with custom payload and correlation ID
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
import {EngineClient} from '@5minds/processcube_engine_client';
|
|
149
|
+
|
|
150
|
+
const engineUri = 'http://localhost:10560';
|
|
151
|
+
|
|
152
|
+
async function run() {
|
|
153
|
+
const client = new EngineClient(engineUri);
|
|
154
|
+
|
|
155
|
+
await client.processDefinitions.startProcessInstance({
|
|
156
|
+
processModelId: 'myProcessModelId',
|
|
157
|
+
correlationId: 'my_custom_correlation_id',
|
|
158
|
+
initialToken: {
|
|
159
|
+
hello: 'world',
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
run();
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
#### Start Process Instance as a sub process
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
import {EngineClient} from '@5minds/processcube_engine_client';
|
|
171
|
+
|
|
172
|
+
const engineUri = 'http://localhost:10560';
|
|
173
|
+
|
|
174
|
+
async function run() {
|
|
175
|
+
const client = new EngineClient(engineUri);
|
|
176
|
+
|
|
177
|
+
await client.processDefinitions.startProcessInstance({
|
|
178
|
+
processModelId: 'myProcessModelId',
|
|
179
|
+
parentProcessInstanceId: 'Some-Other-Process-Instance-Id',
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
run();
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Code Samples
|
|
187
|
+
|
|
188
|
+
You can find [executable code samples here](./samples/client) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).
|
|
189
|
+
|
|
190
|
+
## Query UserTasks
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
import {EngineClient, DataModels} from '@5minds/processcube_engine_client';
|
|
194
|
+
|
|
195
|
+
const engineUri = 'http://localhost:10560';
|
|
196
|
+
|
|
197
|
+
async function run() {
|
|
198
|
+
const client = new EngineClient(engineUri);
|
|
199
|
+
|
|
200
|
+
const userTasks = await client.userTasks.query({
|
|
201
|
+
processModelId: 'myProcessModelId',
|
|
202
|
+
state: DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
console.log(userTasks);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
run();
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## How to use External Task Workers
|
|
212
|
+
|
|
213
|
+
An External Task worker is designed to process External Tasks associated with a BPMN ServiceTask.
|
|
214
|
+
|
|
215
|
+
### Basic
|
|
216
|
+
|
|
217
|
+
You need to provide three arguments to a worker:
|
|
218
|
+
|
|
219
|
+
- The url of the Engine where the worker should connect to
|
|
220
|
+
- The topic by which to poll External Tasks
|
|
221
|
+
- A handler function for processing the External Tasks
|
|
222
|
+
|
|
223
|
+
```ts
|
|
224
|
+
import {EngineClient, DataModels} from '@5minds/processcube_engine_client';
|
|
225
|
+
|
|
226
|
+
interface AddPayload {
|
|
227
|
+
number1: number;
|
|
228
|
+
number2: number;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
interface AddResult {
|
|
232
|
+
sum: number;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const engineUri = 'http://localhost:10560';
|
|
236
|
+
const topic = 'sum_numbers';
|
|
237
|
+
|
|
238
|
+
async function run() {
|
|
239
|
+
const client = new EngineClient(engineUri);
|
|
240
|
+
|
|
241
|
+
const externalTaskWorker = await client.externalTasks.subscribeToExternalTaskTopic(topic, doAdd);
|
|
242
|
+
|
|
243
|
+
externalTaskWorker.start();
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
async function doAdd(
|
|
247
|
+
payload: AddPayload,
|
|
248
|
+
externalTask: DataModels.ExternalTasks.ExternalTask<AddPayload>,
|
|
249
|
+
): Promise<AddResult> {
|
|
250
|
+
|
|
251
|
+
const result: AddResult = {
|
|
252
|
+
sum: payload.number1 + payload.number2,
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
console.log('Receive payload from process instance');
|
|
256
|
+
console.log(JSON.stringify(payload));
|
|
257
|
+
|
|
258
|
+
return Promise.resolve(result);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
run();
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Note that by subscribing to a single topic, you create a specific worker for this topic.
|
|
266
|
+
|
|
267
|
+
### Starting and stopping
|
|
268
|
+
|
|
269
|
+
Start the worker with:
|
|
270
|
+
|
|
271
|
+
```ts
|
|
272
|
+
externalTaskWorker.start();
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
And stop it with:
|
|
276
|
+
|
|
277
|
+
```ts
|
|
278
|
+
externalTaskWorker.stop();
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Code Samples
|
|
282
|
+
|
|
283
|
+
You can find [executable code samples here](./samples/external_task_worker) and [here](https://github.com/atlas-engine/ClientSamples/tree/develop/Client.ts).
|
package/dist/Client.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Identity } from '@5minds/processcube_engine_sdk';
|
|
2
|
+
import * as Clients from './Clients/index';
|
|
3
|
+
export declare class EngineClient {
|
|
4
|
+
private readonly engineUrl;
|
|
5
|
+
private readonly identity;
|
|
6
|
+
private readonly anonymousSessionClient;
|
|
7
|
+
private readonly applicationInfoClient;
|
|
8
|
+
private readonly correlationClient;
|
|
9
|
+
private readonly cronjobClient;
|
|
10
|
+
private readonly dataObjectInstanceClient;
|
|
11
|
+
private readonly emptyActivityClient;
|
|
12
|
+
private readonly eventClient;
|
|
13
|
+
private readonly externalTaskClient;
|
|
14
|
+
private readonly flowNodeInstanceClient;
|
|
15
|
+
private readonly manualTaskClient;
|
|
16
|
+
private readonly notificationClient;
|
|
17
|
+
private readonly processDefinitionClient;
|
|
18
|
+
private readonly processInstanceClient;
|
|
19
|
+
private readonly processModelClient;
|
|
20
|
+
private readonly userTaskClient;
|
|
21
|
+
private readonly userMetadataClient;
|
|
22
|
+
constructor(engineUrl: string, identity?: Identity);
|
|
23
|
+
dispose(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Gets the url of the engine that this client is communicating with.
|
|
26
|
+
*/
|
|
27
|
+
getEngineUrl(): string;
|
|
28
|
+
get anonymousSession(): Clients.AnonymousSessionHttpClient;
|
|
29
|
+
get applicationInfo(): Clients.ApplicationInfoHttpClient;
|
|
30
|
+
get correlations(): Clients.CorrelationHttpClient;
|
|
31
|
+
get cronjobs(): Clients.CronjobHttpClient;
|
|
32
|
+
get dataObjectInstances(): Clients.DataObjectInstanceHttpClient;
|
|
33
|
+
get emptyActivities(): Clients.EmptyActivityHttpClient;
|
|
34
|
+
get events(): Clients.EventHttpClient;
|
|
35
|
+
get externalTasks(): Clients.ExternalTaskClient;
|
|
36
|
+
get flowNodeInstances(): Clients.FlowNodeInstanceHttpClient;
|
|
37
|
+
get manualTasks(): Clients.ManualTaskHttpClient;
|
|
38
|
+
get notification(): Clients.NotificationHttpClient;
|
|
39
|
+
get processDefinitions(): Clients.ProcessDefinitionHttpClient;
|
|
40
|
+
get processInstances(): Clients.ProcessInstanceHttpClient;
|
|
41
|
+
get processModels(): Clients.ProcessModelHttpClient;
|
|
42
|
+
get userTasks(): Clients.UserTaskHttpClient;
|
|
43
|
+
get userMetadata(): Clients.UserMetadataStorageHttpClient;
|
|
44
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Identity } from '@5minds/processcube_engine_sdk';
|
|
2
|
+
import { AnonymousSessionHttpClient, ApplicationInfoHttpClient, CorrelationHttpClient, CronjobHttpClient, DataObjectInstanceHttpClient, EmptyActivityHttpClient, EventHttpClient, ExternalTaskClient, FlowNodeInstanceHttpClient, ManualTaskHttpClient, NotificationHttpClient, ProcessDefinitionHttpClient, ProcessInstanceHttpClient, ProcessModelHttpClient, UserMetadataStorageHttpClient, UserTaskHttpClient } from './Clients/index';
|
|
3
|
+
import { SocketIoManager } from './Clients/Lib/SocketIoManager';
|
|
4
|
+
export declare const ClientFactory: {
|
|
5
|
+
createAnonymousSessionClient: (engineUrl: string, identity?: Identity) => AnonymousSessionHttpClient;
|
|
6
|
+
createApplicationInfoClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => ApplicationInfoHttpClient;
|
|
7
|
+
createCorrelationClient: (engineUrl: string, identity?: Identity) => CorrelationHttpClient;
|
|
8
|
+
createCronJobClient: (engineUrl: string, identity?: Identity) => CronjobHttpClient;
|
|
9
|
+
createDataObjectInstanceClient: (engineUrl: string, identity?: Identity) => DataObjectInstanceHttpClient;
|
|
10
|
+
createEmptyActivityClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => EmptyActivityHttpClient;
|
|
11
|
+
createEventClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => EventHttpClient;
|
|
12
|
+
createExternalTaskClient: (engineUrl: string, identity?: Identity) => ExternalTaskClient;
|
|
13
|
+
createFlowNodeInstanceClient: (engineUrl: string, identity?: Identity) => FlowNodeInstanceHttpClient;
|
|
14
|
+
createManualTaskClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => ManualTaskHttpClient;
|
|
15
|
+
createNotificationClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => NotificationHttpClient;
|
|
16
|
+
createProcessDefinitionClient: (engineUrl: string, identity?: Identity) => ProcessDefinitionHttpClient;
|
|
17
|
+
createProcessInstanceClient: (engineUrl: string, identity?: Identity) => ProcessInstanceHttpClient;
|
|
18
|
+
createProcessModelClient: (engineUrl: string, identity?: Identity) => ProcessModelHttpClient;
|
|
19
|
+
createUserTaskClient: (engineUrl: string, identity?: Identity, socketIoManager?: SocketIoManager) => UserTaskHttpClient;
|
|
20
|
+
createUserMetadataStorageClient: (engineUrl: string, identity?: Identity) => UserMetadataStorageHttpClient;
|
|
21
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnonymousSession, IAnonymousSessionExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk';
|
|
2
|
+
import { BaseClient } from './BaseClient';
|
|
3
|
+
export declare class AnonymousSessionHttpClient extends BaseClient implements IAnonymousSessionExtensionAdapter {
|
|
4
|
+
getAnonymousSessionById(sessionId: string): Promise<AnonymousSession>;
|
|
5
|
+
getAnonymousSessionsByUserId(userId: string): Promise<Array<AnonymousSession>>;
|
|
6
|
+
createAnonymousSessionForIdentity(identity: Identity): Promise<string>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DataModels, IApplicationInfoExtensionAdapter, Identity, Subscription } from '@5minds/processcube_engine_sdk';
|
|
2
|
+
import { Messages as ClientMessages } from '../Types/index';
|
|
3
|
+
import { BaseClient } from './BaseClient';
|
|
4
|
+
export declare class ApplicationInfoHttpClient extends BaseClient implements IApplicationInfoExtensionAdapter {
|
|
5
|
+
getApplicationInfo(): Promise<DataModels.ApplicationInfo>;
|
|
6
|
+
getAuthorityAddress(): Promise<string>;
|
|
7
|
+
onConnected(callback: ClientMessages.CallbackTypes.OnConnected, subscribeOnce?: boolean, identity?: Identity): Subscription;
|
|
8
|
+
onDisconnected(callback: ClientMessages.CallbackTypes.OnDisconnected, subscribeOnce?: boolean, identity?: Identity): Subscription;
|
|
9
|
+
onReconnected(callback: ClientMessages.CallbackTypes.OnReconnected, subscribeOnce?: boolean, identity?: Identity): Subscription;
|
|
10
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Identity, Subscription } from '@5minds/processcube_engine_sdk';
|
|
2
|
+
import { HttpClient, IRequestOptions } from '../HttpClient';
|
|
3
|
+
import { SocketIoManager } from './Lib/SocketIoManager';
|
|
4
|
+
export declare class BaseClient {
|
|
5
|
+
identity: Identity;
|
|
6
|
+
protected httpClient: HttpClient;
|
|
7
|
+
protected readonly socketIoManager: SocketIoManager;
|
|
8
|
+
private readonly baseUrl;
|
|
9
|
+
private readonly engineUrl;
|
|
10
|
+
constructor(engineUrl: string, identity: Identity, socketIoManager?: SocketIoManager);
|
|
11
|
+
get connected(): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Gets the url of the engine that this client is communicating with.
|
|
14
|
+
*/
|
|
15
|
+
getEngineUrl(): string;
|
|
16
|
+
isSocketConnected(identity?: Identity): boolean;
|
|
17
|
+
disconnectSocket(identity: Identity): void;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
protected buildUrl<TQuery, TSort>(url: string, offset?: number, limit?: number, query?: TQuery, sortSettings?: TSort): string;
|
|
20
|
+
protected createRequestAuthHeaders(identity: Identity): IRequestOptions;
|
|
21
|
+
protected createSocketIoSubscription(route: string, callback: Function, subscribeOnce: boolean, identity?: Identity): Subscription;
|
|
22
|
+
protected removeSocketIoSubscription(subscription: Subscription, identity?: Identity): void;
|
|
23
|
+
protected addParameterToUrl<TValue>(url: string, parameterName: string, parameterValue: TValue): string;
|
|
24
|
+
private encodeQueryAndAddParametersToUrl;
|
|
25
|
+
private encodeValue;
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DataModels, ICorrelationExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk';
|
|
2
|
+
import { BaseClient } from './BaseClient';
|
|
3
|
+
export declare class CorrelationHttpClient extends BaseClient implements ICorrelationExtensionAdapter {
|
|
4
|
+
getAll(options?: {
|
|
5
|
+
identity?: Identity;
|
|
6
|
+
includeProcessInstances?: boolean;
|
|
7
|
+
offset?: number;
|
|
8
|
+
limit?: number;
|
|
9
|
+
sortSettings?: DataModels.Correlation.CorrelationSortSettings;
|
|
10
|
+
}): Promise<DataModels.Correlation.CorrelationList>;
|
|
11
|
+
getById(correlationId: string, options?: {
|
|
12
|
+
identity?: Identity;
|
|
13
|
+
includeProcessInstances?: boolean;
|
|
14
|
+
}): Promise<DataModels.Correlation.Correlation>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DataModels, ICronjobExtensionAdapter, Identity, DeployedCronjobList, CronjobQuery, CronjobSortSettings } from '@5minds/processcube_engine_sdk';
|
|
2
|
+
import { BaseClient } from './BaseClient';
|
|
3
|
+
export declare class CronjobHttpClient extends BaseClient implements ICronjobExtensionAdapter {
|
|
4
|
+
query(query: CronjobQuery, options?: {
|
|
5
|
+
identity?: Identity;
|
|
6
|
+
offset?: number;
|
|
7
|
+
limit?: number;
|
|
8
|
+
sortSettings?: CronjobSortSettings;
|
|
9
|
+
}): Promise<DeployedCronjobList>;
|
|
10
|
+
enableCronjob(processModelId: string, flowNodeId: string, identity?: Identity): Promise<void>;
|
|
11
|
+
disableCronjob(processModelId: string, flowNodeId: string, identity?: Identity): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use "query" instead.
|
|
14
|
+
*/
|
|
15
|
+
getActive(options?: {
|
|
16
|
+
identity?: Identity;
|
|
17
|
+
offset?: number;
|
|
18
|
+
limit?: number;
|
|
19
|
+
}): Promise<DataModels.Cronjob.CronjobList>;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use "query" instead.
|
|
22
|
+
*/
|
|
23
|
+
queryHistory(query: DataModels.Cronjob.CronjobHistoryQuery, options?: {
|
|
24
|
+
identity?: Identity;
|
|
25
|
+
offset?: number;
|
|
26
|
+
limit?: number;
|
|
27
|
+
sortSettings?: DataModels.Cronjob.CronjobHistorySortSettings;
|
|
28
|
+
}): Promise<DataModels.Cronjob.CronjobHistoryList>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DataModels, IDataObjectInstanceExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk';
|
|
2
|
+
import { BaseClient } from './BaseClient';
|
|
3
|
+
export declare class DataObjectInstanceHttpClient extends BaseClient implements IDataObjectInstanceExtensionAdapter {
|
|
4
|
+
query(query: DataModels.DataObjects.DataObjectInstanceQuery, options?: {
|
|
5
|
+
identity?: Identity;
|
|
6
|
+
offset?: number;
|
|
7
|
+
limit?: number;
|
|
8
|
+
sortSettings?: DataModels.DataObjects.DataObjectSortSettings;
|
|
9
|
+
}): Promise<DataModels.DataObjects.DataObjectInstanceList>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DataModels, IEmptyActivityExtensionAdapter, Identity, Messages, Subscription } from '@5minds/processcube_engine_sdk';
|
|
2
|
+
import { BaseClient } from './BaseClient';
|
|
3
|
+
type EmptyActivityList = DataModels.FlowNodeInstances.EmptyActivityList;
|
|
4
|
+
export declare class EmptyActivityHttpClient extends BaseClient implements IEmptyActivityExtensionAdapter {
|
|
5
|
+
query(query: DataModels.FlowNodeInstances.EmptyActivityQuery, options?: {
|
|
6
|
+
identity?: Identity;
|
|
7
|
+
offset?: number;
|
|
8
|
+
limit?: number;
|
|
9
|
+
sortSettings?: DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings;
|
|
10
|
+
}): Promise<EmptyActivityList>;
|
|
11
|
+
finishEmptyActivity(emptyActivityInstanceId: string, identity?: Identity): Promise<void>;
|
|
12
|
+
onEmptyActivityWaiting(callback: Messages.CallbackTypes.OnEmptyActivityWaitingCallback, options?: {
|
|
13
|
+
subscribeOnce?: boolean;
|
|
14
|
+
identity?: Identity;
|
|
15
|
+
}): Promise<Subscription>;
|
|
16
|
+
onEmptyActivityFinished(callback: Messages.CallbackTypes.OnEmptyActivityFinishedCallback, options?: {
|
|
17
|
+
subscribeOnce?: boolean;
|
|
18
|
+
identity?: Identity;
|
|
19
|
+
}): Promise<Subscription>;
|
|
20
|
+
removeSubscription(subscription: Subscription, identity?: Identity): void;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { DataModels, IEventExtensionAdapter, Identity, Messages, Subscription } from '@5minds/processcube_engine_sdk';
|
|
2
|
+
import { BaseClient } from './BaseClient';
|
|
3
|
+
type EventList = DataModels.FlowNodeInstances.EventList;
|
|
4
|
+
export declare class EventHttpClient extends BaseClient implements IEventExtensionAdapter {
|
|
5
|
+
query(query: DataModels.FlowNodeInstances.EventQuery, options?: {
|
|
6
|
+
identity?: Identity;
|
|
7
|
+
offset?: number;
|
|
8
|
+
limit?: number;
|
|
9
|
+
sortSettings?: DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings;
|
|
10
|
+
}): Promise<EventList>;
|
|
11
|
+
triggerMessageEvent<TPayload>(messageName: string, options?: {
|
|
12
|
+
processInstanceId?: string;
|
|
13
|
+
payload?: TPayload;
|
|
14
|
+
identity?: Identity;
|
|
15
|
+
}): Promise<void>;
|
|
16
|
+
triggerSignalEvent<TPayload>(signalName: string, options?: {
|
|
17
|
+
processInstanceId?: string;
|
|
18
|
+
payload?: TPayload;
|
|
19
|
+
identity?: Identity;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
onBoundaryEventTriggered(callback: Messages.CallbackTypes.OnBoundaryEventTriggeredCallback, options?: {
|
|
22
|
+
subscribeOnce?: boolean;
|
|
23
|
+
identity?: Identity;
|
|
24
|
+
}): Promise<Subscription>;
|
|
25
|
+
onIntermediateThrowEventTriggered(callback: Messages.CallbackTypes.OnIntermediateThrowEventTriggeredCallback, options?: {
|
|
26
|
+
subscribeOnce?: boolean;
|
|
27
|
+
identity?: Identity;
|
|
28
|
+
}): Promise<Subscription>;
|
|
29
|
+
onIntermediateCatchEventReached(callback: Messages.CallbackTypes.OnIntermediateCatchEventReachedCallback, options?: {
|
|
30
|
+
subscribeOnce?: boolean;
|
|
31
|
+
identity?: Identity;
|
|
32
|
+
}): Promise<Subscription>;
|
|
33
|
+
onIntermediateCatchEventFinished(callback: Messages.CallbackTypes.OnIntermediateCatchEventFinishedCallback, options?: {
|
|
34
|
+
subscribeOnce?: boolean;
|
|
35
|
+
identity?: Identity;
|
|
36
|
+
}): Promise<Subscription>;
|
|
37
|
+
onMessageTriggered(callback: Messages.CallbackTypes.OnMessageTriggeredCallback, options?: {
|
|
38
|
+
subscribeOnce?: boolean;
|
|
39
|
+
identity?: Identity;
|
|
40
|
+
}): Promise<Subscription>;
|
|
41
|
+
onSignalTriggered(callback: Messages.CallbackTypes.OnSignalTriggeredCallback, options?: {
|
|
42
|
+
subscribeOnce?: boolean;
|
|
43
|
+
identity?: Identity;
|
|
44
|
+
}): Promise<Subscription>;
|
|
45
|
+
onStartEventFinished(callback: Messages.CallbackTypes.OnStartEventFinishedCallback, options?: {
|
|
46
|
+
subscribeOnce?: boolean;
|
|
47
|
+
identity?: Identity;
|
|
48
|
+
}): Promise<Subscription>;
|
|
49
|
+
onEndEventFinished(callback: Messages.CallbackTypes.OnEndEventFinishedCallback, options?: {
|
|
50
|
+
subscribeOnce?: boolean;
|
|
51
|
+
identity?: Identity;
|
|
52
|
+
}): Promise<Subscription>;
|
|
53
|
+
removeSubscription(subscription: Subscription, identity?: Identity): void;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DataModels, IExternalTaskExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk';
|
|
2
|
+
import { BaseClient } from './BaseClient';
|
|
3
|
+
type ExternalTask<TPayload> = DataModels.ExternalTasks.ExternalTask<TPayload>;
|
|
4
|
+
export declare class ExternalTaskApiClient extends BaseClient implements IExternalTaskExtensionAdapter {
|
|
5
|
+
getAllDeployedTopics(identity?: Identity): Promise<Array<string>>;
|
|
6
|
+
fetchAndLockExternalTasks<TPayload>(workerId: string, topicNames: string | Array<string>, maxTasks: number, longPollingTimeout: number, lockDuration: number, payloadFilter?: RegExp, identity?: Identity): Promise<Array<ExternalTask<TPayload>>>;
|
|
7
|
+
extendLock(workerId: string, externalTaskId: string, additionalDuration: number, identity?: Identity): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use handleError instead.
|
|
10
|
+
*/
|
|
11
|
+
handleBpmnError(workerId: string, externalTaskId: string, error: DataModels.ExternalTasks.ExternalTaskBpmnError, identity?: Identity): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use handleError instead.
|
|
14
|
+
*/
|
|
15
|
+
handleServiceError(workerId: string, externalTaskId: string, error: DataModels.ExternalTasks.ExternalTaskServiceError, identity?: Identity): Promise<void>;
|
|
16
|
+
handleError(workerId: string, externalTaskId: string, error: DataModels.ExternalTasks.ExternalTaskServiceError, identity?: Identity): Promise<void>;
|
|
17
|
+
finishExternalTask<TResultType>(workerId: string, externalTaskId: string, result: TResultType, identity?: Identity): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Identity } from '@5minds/processcube_engine_sdk';
|
|
2
|
+
import { HandleExternalTaskAction, IExternalTaskWorker, IExternalTaskWorkerConfig } from '../Types/index';
|
|
3
|
+
export declare class ExternalTaskClient {
|
|
4
|
+
private engineUrl;
|
|
5
|
+
private identity;
|
|
6
|
+
constructor(engineUrl: string, identity: Identity);
|
|
7
|
+
/**
|
|
8
|
+
* Gets the url of the engine that this client is communicating with.
|
|
9
|
+
*/
|
|
10
|
+
getEngineUrl(): string;
|
|
11
|
+
subscribeToExternalTaskTopic<TExternalTaskPayload, TResultPayload extends object>(topic: string, processingFunction: HandleExternalTaskAction<TExternalTaskPayload, TResultPayload>, config?: IExternalTaskWorkerConfig): Promise<IExternalTaskWorker>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DataModels, IFlowNodeInstanceExtensionAdapter, Identity } from '@5minds/processcube_engine_sdk';
|
|
2
|
+
import { BaseClient } from './BaseClient';
|
|
3
|
+
export declare class FlowNodeInstanceHttpClient extends BaseClient implements IFlowNodeInstanceExtensionAdapter {
|
|
4
|
+
query(query: DataModels.FlowNodeInstances.GenericFlowNodeInstanceQuery, options?: {
|
|
5
|
+
identity?: Identity;
|
|
6
|
+
offset?: number;
|
|
7
|
+
limit?: number;
|
|
8
|
+
sortSettings?: DataModels.FlowNodeInstances.FlowNodeInstanceSortSettings;
|
|
9
|
+
}): Promise<DataModels.FlowNodeInstances.FlowNodeInstanceList>;
|
|
10
|
+
finishEmptyActivity(emptyActivityInstanceId: string, identity?: Identity): Promise<void>;
|
|
11
|
+
finishManualTask(manualTaskInstanceId: string, identity?: Identity): Promise<void>;
|
|
12
|
+
finishUserTask(userTaskInstanceId: string, userTaskResult: DataModels.FlowNodeInstances.UserTaskResult, identity?: Identity): Promise<void>;
|
|
13
|
+
triggerMessageEvent<TPayload>(messageName: string, options?: {
|
|
14
|
+
processInstanceId?: string;
|
|
15
|
+
payload?: TPayload;
|
|
16
|
+
identity?: Identity;
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
triggerSignalEvent<TPayload>(signalName: string, options?: {
|
|
19
|
+
processInstanceId?: string;
|
|
20
|
+
payload?: TPayload;
|
|
21
|
+
identity?: Identity;
|
|
22
|
+
}): Promise<void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AnonymousSession, DataModels, Cronjob } from '@5minds/processcube_engine_sdk';
|
|
2
|
+
export declare function mapAnonymousSession(rawSession: any): AnonymousSession;
|
|
3
|
+
export declare function mapProcessDefinition(rawDefinition: any): DataModels.ProcessDefinitions.ProcessDefinition;
|
|
4
|
+
export declare function mapProcessModel(rawModel: any): DataModels.ProcessDefinitions.ProcessModel;
|
|
5
|
+
export declare function mapFlowNodeInstance(data: any): DataModels.FlowNodeInstances.FlowNodeInstance;
|
|
6
|
+
export declare function mapCallActivity(data: any): DataModels.FlowNodeInstances.CallActivityInstance;
|
|
7
|
+
export declare function mapSubprocess(data: any): DataModels.FlowNodeInstances.SubprocessInstance;
|
|
8
|
+
export declare function mapEmptyActivity(data: any): DataModels.FlowNodeInstances.EmptyActivityInstance;
|
|
9
|
+
export declare function mapEvent(data: any): DataModels.FlowNodeInstances.EventInstance;
|
|
10
|
+
export declare function mapManualTask(data: any): DataModels.FlowNodeInstances.ManualTaskInstance;
|
|
11
|
+
export declare function mapReceiveTask(data: any): DataModels.FlowNodeInstances.ReceiveTaskInstance;
|
|
12
|
+
export declare function mapServiceTask(data: any): DataModels.FlowNodeInstances.ServiceTaskInstance;
|
|
13
|
+
export declare function mapUserTask(data: any): DataModels.FlowNodeInstances.UserTaskInstance;
|
|
14
|
+
export declare function mapProcessToken(data: DataModels.FlowNodeInstances.ProcessToken): DataModels.FlowNodeInstances.ProcessToken;
|
|
15
|
+
export declare function mapCronjobConfiguration(data: any): Cronjob;
|
|
16
|
+
export declare function mapActiveCronjobConfiguration(data: any): DataModels.Cronjob.ActiveCronjob;
|
|
17
|
+
export declare function mapCronjobHistory(data: any): DataModels.Cronjob.CronjobHistoryEntry;
|
|
18
|
+
export declare function mapDataObjectInstance(data: any): DataModels.DataObjects.DataObjectInstance<object>;
|
|
19
|
+
export declare function mapExternalTask<TPayload>(data: any): DataModels.ExternalTasks.ExternalTask<TPayload>;
|
|
20
|
+
export declare function mapProcessInstance(data: any): DataModels.ProcessInstances.ProcessInstance;
|