@quantumbpm/sdk 1.2.0 → 2.0.0
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/README.md +93 -34
- package/dist/auth.d.ts +19 -14
- package/dist/auth.js +62 -84
- package/dist/bpmn.d.ts +83 -21
- package/dist/bpmn.js +61 -33
- package/dist/dmn.d.ts +0 -6
- package/dist/dmn.js +1 -15
- package/dist/generated/RawClient.js +2 -2
- package/dist/generated/core/OpenAPI.js +2 -2
- package/dist/generated/index.d.ts +9 -2
- package/dist/generated/index.js +8 -4
- package/dist/generated/models/BpmnActivityState.d.ts +85 -0
- package/dist/generated/models/BpmnActivityState.js +18 -0
- package/dist/generated/models/BpmnElementStatistics.d.ts +36 -0
- package/dist/generated/models/BpmnElementStatistics.js +17 -0
- package/dist/generated/models/BpmnExternalJobPaginatedResponse.d.ts +2 -2
- package/dist/generated/models/BpmnExternalJobPaginatedResponse.js +1 -1
- package/dist/generated/models/BpmnHistoryPage.d.ts +15 -0
- package/dist/generated/models/BpmnHistoryPage.js +3 -0
- package/dist/generated/models/BpmnIncident.d.ts +17 -17
- package/dist/generated/models/BpmnIncident.js +11 -11
- package/dist/generated/models/BpmnIncidentRecord.d.ts +10 -18
- package/dist/generated/models/BpmnIncidentRecord.js +6 -6
- package/dist/generated/models/BpmnIncidentRecordPaginatedResponse.d.ts +2 -2
- package/dist/generated/models/BpmnIncidentRecordPaginatedResponse.js +1 -1
- package/dist/generated/models/BpmnInstance.d.ts +21 -29
- package/dist/generated/models/BpmnInstance.js +1 -17
- package/dist/generated/models/BpmnInstancePaginatedResponse.d.ts +2 -2
- package/dist/generated/models/BpmnInstancePaginatedResponse.js +1 -1
- package/dist/generated/models/BpmnInstanceState.d.ts +49 -16
- package/dist/generated/models/BpmnInstanceState.js +1 -1
- package/dist/generated/models/BpmnInstanceStatus.d.ts +10 -0
- package/dist/generated/models/BpmnInstanceStatus.js +19 -0
- package/dist/generated/models/BpmnProcessDefinition.d.ts +5 -5
- package/dist/generated/models/BpmnProcessDefinition.js +1 -1
- package/dist/generated/models/BpmnProcessVersion.d.ts +9 -9
- package/dist/generated/models/BpmnProcessVersion.js +1 -1
- package/dist/generated/models/BpmnUserTaskPaginatedResponse.d.ts +2 -2
- package/dist/generated/models/BpmnUserTaskPaginatedResponse.js +1 -1
- package/dist/generated/models/CorrelationKeyNumber.d.ts +1 -1
- package/dist/generated/models/CorrelationKeyNumber.js +1 -1
- package/dist/generated/models/CorrelationKeys.d.ts +7 -6
- package/dist/generated/models/CorrelationKeys.js +1 -1
- package/dist/generated/models/CreateDefinitionRequest.d.ts +1 -5
- package/dist/generated/models/CreateDefinitionRequest.js +1 -1
- package/dist/generated/models/CursorPage.d.ts +12 -0
- package/dist/generated/models/CursorPage.js +3 -0
- package/dist/generated/models/DecisionSummary.d.ts +2 -2
- package/dist/generated/models/DecisionSummary.js +1 -1
- package/dist/generated/models/DecisionVersion.d.ts +25 -0
- package/dist/generated/models/DecisionVersion.js +3 -0
- package/dist/generated/models/DecisionVersionList.d.ts +7 -0
- package/dist/generated/models/DecisionVersionList.js +3 -0
- package/dist/generated/models/Definition.d.ts +16 -8
- package/dist/generated/models/Definition.js +1 -1
- package/dist/generated/models/Error.d.ts +8 -2
- package/dist/generated/models/Error.js +6 -2
- package/dist/generated/models/EvaluateStoredRequest.d.ts +6 -4
- package/dist/generated/models/EvaluateStoredRequest.js +1 -1
- package/dist/generated/models/EvaluationResult.d.ts +6 -0
- package/dist/generated/models/EvaluationResult.js +1 -1
- package/dist/generated/models/Execution.d.ts +30 -9
- package/dist/generated/models/Execution.js +1 -1
- package/dist/generated/models/ExternalJob.d.ts +9 -9
- package/dist/generated/models/ExternalJob.js +1 -1
- package/dist/generated/models/ExternalJobBatchResponse.d.ts +2 -2
- package/dist/generated/models/ExternalJobBatchResponse.js +1 -1
- package/dist/generated/models/JoinArrivals.d.ts +8 -0
- package/dist/generated/models/JoinArrivals.js +3 -0
- package/dist/generated/models/PollBpmnJobRequest.d.ts +1 -1
- package/dist/generated/models/PollBpmnJobRequest.js +1 -1
- package/dist/generated/models/StartBpmnInstanceRequest.d.ts +6 -2
- package/dist/generated/models/StartBpmnInstanceRequest.js +1 -1
- package/dist/generated/models/SuspendBpmnInstanceRequest.d.ts +1 -1
- package/dist/generated/models/SuspendBpmnInstanceRequest.js +1 -1
- package/dist/generated/models/SuspensionEntry.d.ts +2 -2
- package/dist/generated/models/SuspensionEntry.js +1 -1
- package/dist/generated/models/UpdateDefinitionRequest.d.ts +1 -5
- package/dist/generated/models/UpdateDefinitionRequest.js +1 -1
- package/dist/generated/models/UpdateUserTaskAssignmentRequest.d.ts +11 -4
- package/dist/generated/models/UpdateUserTaskAssignmentRequest.js +1 -1
- package/dist/generated/models/UserTask.d.ts +15 -11
- package/dist/generated/models/UserTask.js +1 -1
- package/dist/generated/services/BpmnService.d.ts +191 -94
- package/dist/generated/services/BpmnService.js +300 -119
- package/dist/generated/services/DefaultService.d.ts +118 -118
- package/dist/generated/services/DefaultService.js +156 -160
- package/dist/index.d.ts +8 -8
- package/dist/index.js +7 -7
- package/dist/tracing.js +2 -2
- package/dist/workers.d.ts +41 -7
- package/dist/workers.js +186 -53
- package/package.json +2 -4
- package/src/auth.test.ts +128 -0
- package/src/auth.ts +67 -64
- package/src/bpmn.ts +131 -43
- package/src/dmn.ts +0 -19
- package/src/generated/RawClient.ts +1 -1
- package/src/generated/core/OpenAPI.ts +1 -1
- package/src/generated/index.ts +9 -2
- package/src/generated/models/BpmnActivityState.ts +90 -0
- package/src/generated/models/BpmnElementStatistics.ts +41 -0
- package/src/generated/models/BpmnExternalJobPaginatedResponse.ts +2 -2
- package/src/generated/models/BpmnHistoryPage.ts +20 -0
- package/src/generated/models/BpmnIncident.ts +17 -17
- package/src/generated/models/BpmnIncidentRecord.ts +10 -18
- package/src/generated/models/BpmnIncidentRecordPaginatedResponse.ts +2 -2
- package/src/generated/models/BpmnInstance.ts +21 -29
- package/src/generated/models/BpmnInstancePaginatedResponse.ts +2 -2
- package/src/generated/models/BpmnInstanceState.ts +49 -16
- package/src/generated/models/BpmnInstanceStatus.ts +14 -0
- package/src/generated/models/BpmnProcessDefinition.ts +5 -5
- package/src/generated/models/BpmnProcessVersion.ts +9 -9
- package/src/generated/models/BpmnUserTaskPaginatedResponse.ts +2 -2
- package/src/generated/models/CorrelationKeyNumber.ts +1 -1
- package/src/generated/models/CorrelationKeys.ts +7 -6
- package/src/generated/models/CreateDefinitionRequest.ts +1 -5
- package/src/generated/models/CursorPage.ts +17 -0
- package/src/generated/models/DecisionSummary.ts +2 -2
- package/src/generated/models/DecisionVersion.ts +30 -0
- package/src/generated/models/DecisionVersionList.ts +12 -0
- package/src/generated/models/Definition.ts +16 -8
- package/src/generated/models/Error.ts +8 -2
- package/src/generated/models/EvaluateStoredRequest.ts +6 -4
- package/src/generated/models/EvaluationResult.ts +6 -0
- package/src/generated/models/Execution.ts +30 -9
- package/src/generated/models/ExternalJob.ts +9 -9
- package/src/generated/models/ExternalJobBatchResponse.ts +2 -2
- package/src/generated/models/JoinArrivals.ts +13 -0
- package/src/generated/models/PollBpmnJobRequest.ts +1 -1
- package/src/generated/models/StartBpmnInstanceRequest.ts +6 -2
- package/src/generated/models/SuspendBpmnInstanceRequest.ts +1 -1
- package/src/generated/models/SuspensionEntry.ts +2 -2
- package/src/generated/models/UpdateDefinitionRequest.ts +1 -5
- package/src/generated/models/UpdateUserTaskAssignmentRequest.ts +11 -4
- package/src/generated/models/UserTask.ts +15 -11
- package/src/generated/services/BpmnService.ts +357 -140
- package/src/generated/services/DefaultService.ts +178 -189
- package/src/index.test.ts +77 -31
- package/src/index.ts +13 -6
- package/src/tracing.ts +1 -1
- package/src/workers.test.ts +280 -3
- package/src/workers.ts +200 -60
- package/dist/generated/models/CreateProjectRequest.d.ts +0 -9
- package/dist/generated/models/CreateProjectRequest.js +0 -3
- package/src/generated/models/CreateProjectRequest.ts +0 -14
|
@@ -8,7 +8,7 @@ import type { BpmnExternalJobPaginatedResponse } from '../models/BpmnExternalJob
|
|
|
8
8
|
import type { BpmnInstancePaginatedResponse } from '../models/BpmnInstancePaginatedResponse';
|
|
9
9
|
import type { BpmnInstanceState } from '../models/BpmnInstanceState';
|
|
10
10
|
import type { CreateDefinitionRequest } from '../models/CreateDefinitionRequest';
|
|
11
|
-
import type {
|
|
11
|
+
import type { DecisionVersionList } from '../models/DecisionVersionList';
|
|
12
12
|
import type { Definition } from '../models/Definition';
|
|
13
13
|
import type { ErrorMode } from '../models/ErrorMode';
|
|
14
14
|
import type { EvaluateStoredRequest } from '../models/EvaluateStoredRequest';
|
|
@@ -34,8 +34,6 @@ export class DefaultService {
|
|
|
34
34
|
*/
|
|
35
35
|
public getVersion(): CancelablePromise<{
|
|
36
36
|
version?: string;
|
|
37
|
-
buildTime?: string;
|
|
38
|
-
commit?: string;
|
|
39
37
|
}> {
|
|
40
38
|
return this.httpRequest.request({
|
|
41
39
|
method: 'GET',
|
|
@@ -112,7 +110,9 @@ export class DefaultService {
|
|
|
112
110
|
}
|
|
113
111
|
/**
|
|
114
112
|
* List Projects
|
|
115
|
-
* Lists projects the caller
|
|
113
|
+
* Lists the projects the caller's token grants access to. Projects come
|
|
114
|
+
* from the deployment's provisioning file.
|
|
115
|
+
*
|
|
116
116
|
* @returns Project OK
|
|
117
117
|
* @throws ApiError
|
|
118
118
|
*/
|
|
@@ -125,31 +125,6 @@ export class DefaultService {
|
|
|
125
125
|
},
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
/**
|
|
129
|
-
* Create Project
|
|
130
|
-
* Creates a new project. Projects are workspaces that group DMN definitions
|
|
131
|
-
* and BPMN processes for execution and access control. The caller is
|
|
132
|
-
* automatically added as a project administrator.
|
|
133
|
-
*
|
|
134
|
-
* @param requestBody
|
|
135
|
-
* @returns Project Created
|
|
136
|
-
* @throws ApiError
|
|
137
|
-
*/
|
|
138
|
-
public createProject(
|
|
139
|
-
requestBody: CreateProjectRequest,
|
|
140
|
-
): CancelablePromise<Project> {
|
|
141
|
-
return this.httpRequest.request({
|
|
142
|
-
method: 'POST',
|
|
143
|
-
url: '/projects',
|
|
144
|
-
body: requestBody,
|
|
145
|
-
mediaType: 'application/json',
|
|
146
|
-
errors: {
|
|
147
|
-
400: `Bad Request`,
|
|
148
|
-
403: `Project quota for the caller's tier has been reached.`,
|
|
149
|
-
500: `Internal Server Error`,
|
|
150
|
-
},
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
128
|
/**
|
|
154
129
|
* Get Project
|
|
155
130
|
* Returns the project's metadata.
|
|
@@ -173,36 +148,9 @@ export class DefaultService {
|
|
|
173
148
|
},
|
|
174
149
|
});
|
|
175
150
|
}
|
|
176
|
-
/**
|
|
177
|
-
* Delete Project
|
|
178
|
-
* Permanently deletes a project and all of its data: DMN definitions and
|
|
179
|
-
* executions, BPMN resources and instances, jobs, user tasks, messages,
|
|
180
|
-
* signals, and members. Running BPMN instances are terminated. This
|
|
181
|
-
* action cannot be undone.
|
|
182
|
-
*
|
|
183
|
-
* @param projectId Identifier of the project to delete.
|
|
184
|
-
* @returns void
|
|
185
|
-
* @throws ApiError
|
|
186
|
-
*/
|
|
187
|
-
public deleteProject(
|
|
188
|
-
projectId: string,
|
|
189
|
-
): CancelablePromise<void> {
|
|
190
|
-
return this.httpRequest.request({
|
|
191
|
-
method: 'DELETE',
|
|
192
|
-
url: '/projects/{projectID}',
|
|
193
|
-
path: {
|
|
194
|
-
'projectID': projectId,
|
|
195
|
-
},
|
|
196
|
-
errors: {
|
|
197
|
-
400: `Bad Request`,
|
|
198
|
-
404: `Not Found`,
|
|
199
|
-
500: `Internal Server Error`,
|
|
200
|
-
},
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
151
|
/**
|
|
204
152
|
* List DMN definitions
|
|
205
|
-
* Lists
|
|
153
|
+
* Lists every saved definition in the project, drafts and deployed, newest first.
|
|
206
154
|
* @param projectId
|
|
207
155
|
* @param page Page number (1-indexed)
|
|
208
156
|
* @param pageSize Number of items per page (max 100)
|
|
@@ -233,9 +181,11 @@ export class DefaultService {
|
|
|
233
181
|
}
|
|
234
182
|
/**
|
|
235
183
|
* Create a DMN definition
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
184
|
+
* Saves a new draft. A draft is not evaluable until `DeployDefinition`
|
|
185
|
+
* deploys it. To change a deployed definition, save its new XML as
|
|
186
|
+
* another draft of the same `definitionsID` and deploy that. XML
|
|
187
|
+
* identical to the latest deployed version of its `definitionsID` is
|
|
188
|
+
* refused with 409, and nothing is saved.
|
|
239
189
|
*
|
|
240
190
|
* @param projectId
|
|
241
191
|
* @param requestBody
|
|
@@ -257,13 +207,14 @@ export class DefaultService {
|
|
|
257
207
|
errors: {
|
|
258
208
|
400: `Bad Request`,
|
|
259
209
|
404: `Not Found`,
|
|
210
|
+
409: `Conflict`,
|
|
260
211
|
500: `Internal Server Error`,
|
|
261
212
|
},
|
|
262
213
|
});
|
|
263
214
|
}
|
|
264
215
|
/**
|
|
265
216
|
* List latest DMN definitions
|
|
266
|
-
* Returns the
|
|
217
|
+
* Returns the newest saved definition of each `definitionsID`, draft or deployed.
|
|
267
218
|
* @param projectId
|
|
268
219
|
* @param page Page number (1-indexed)
|
|
269
220
|
* @param pageSize Number of items per page (max 100)
|
|
@@ -294,13 +245,14 @@ export class DefaultService {
|
|
|
294
245
|
}
|
|
295
246
|
/**
|
|
296
247
|
* Get a DMN definition by its DMN definitions id
|
|
297
|
-
* Looks up a definition by the `id` attribute on the
|
|
298
|
-
* element of the DMN XML, instead of by the
|
|
299
|
-
* Returns the latest version unless
|
|
248
|
+
* Looks up a deployed definition by the `id` attribute on the
|
|
249
|
+
* `<definitions>` root element of the DMN XML, instead of by the
|
|
250
|
+
* platform-internal `id`. Returns the latest deployed version unless
|
|
251
|
+
* `version` names one. A draft is not found this way.
|
|
300
252
|
*
|
|
301
253
|
* @param projectId
|
|
302
254
|
* @param definitionsId Stable identifier from the DMN XML's outer `<definitions id="…">` attribute.
|
|
303
|
-
* @param version
|
|
255
|
+
* @param version Deployed version, the latest when omitted.
|
|
304
256
|
* @returns Definition OK
|
|
305
257
|
* @throws ApiError
|
|
306
258
|
*/
|
|
@@ -327,7 +279,7 @@ export class DefaultService {
|
|
|
327
279
|
}
|
|
328
280
|
/**
|
|
329
281
|
* List all versions of a DMN definition
|
|
330
|
-
* Returns every
|
|
282
|
+
* Returns every saved definition of a DMN `<definitions id>`, drafts and deployed, newest first. A deployed one carries the version its deploy gave it.
|
|
331
283
|
* @param projectId
|
|
332
284
|
* @param definitionsId Stable identifier from the DMN XML's outer `<definitions id="…">` attribute.
|
|
333
285
|
* @param page Page number (1-indexed)
|
|
@@ -361,15 +313,15 @@ export class DefaultService {
|
|
|
361
313
|
}
|
|
362
314
|
/**
|
|
363
315
|
* Evaluate a DMN definition by its DMN definitions id
|
|
364
|
-
* Evaluates a
|
|
365
|
-
* XML attribute
|
|
366
|
-
*
|
|
367
|
-
*
|
|
316
|
+
* Evaluates a deployed DMN definition addressed by its `<definitions id>`
|
|
317
|
+
* XML attribute, the latest deployed version unless `version` names one,
|
|
318
|
+
* and records the evaluation. A definition with no deployed version
|
|
319
|
+
* answers 404. Drafts evaluate through `EvaluateDesign`.
|
|
368
320
|
*
|
|
369
321
|
* @param projectId
|
|
370
322
|
* @param definitionsId Stable identifier from the DMN XML's outer `<definitions id="…">` attribute.
|
|
371
323
|
* @param requestBody
|
|
372
|
-
* @param version
|
|
324
|
+
* @param version Deployed version, the latest when omitted.
|
|
373
325
|
* @returns EvaluationResult OK
|
|
374
326
|
* @throws ApiError
|
|
375
327
|
*/
|
|
@@ -426,7 +378,7 @@ export class DefaultService {
|
|
|
426
378
|
}
|
|
427
379
|
/**
|
|
428
380
|
* Update a DMN definition version
|
|
429
|
-
* Replaces the name and XML of a
|
|
381
|
+
* Replaces the name and XML of a draft. A deployed definition is read-only and answers 409, so save the change as a new draft instead.
|
|
430
382
|
* @param projectId
|
|
431
383
|
* @param definitionId
|
|
432
384
|
* @param requestBody
|
|
@@ -450,13 +402,14 @@ export class DefaultService {
|
|
|
450
402
|
errors: {
|
|
451
403
|
400: `Bad Request`,
|
|
452
404
|
404: `Not Found`,
|
|
405
|
+
409: `Conflict`,
|
|
453
406
|
500: `Internal Server Error`,
|
|
454
407
|
},
|
|
455
408
|
});
|
|
456
409
|
}
|
|
457
410
|
/**
|
|
458
411
|
* Delete a DMN definition version
|
|
459
|
-
* Permanently deletes a
|
|
412
|
+
* Permanently deletes a draft. A deployed definition answers 409, since the engine keeps its version and evaluations.
|
|
460
413
|
* @param projectId
|
|
461
414
|
* @param definitionId
|
|
462
415
|
* @returns void
|
|
@@ -476,115 +429,100 @@ export class DefaultService {
|
|
|
476
429
|
errors: {
|
|
477
430
|
400: `Bad Request`,
|
|
478
431
|
404: `Not Found`,
|
|
432
|
+
409: `Conflict`,
|
|
479
433
|
500: `Internal Server Error`,
|
|
480
434
|
},
|
|
481
435
|
});
|
|
482
436
|
}
|
|
483
437
|
/**
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
*
|
|
438
|
+
* Deploy a DMN definition
|
|
439
|
+
* Deploys a draft, which makes its decisions evaluable and callable from
|
|
440
|
+
* business rule tasks. Its document gets the next version of its
|
|
441
|
+
* `definitionsID`, and each decision the next version of its decision id.
|
|
442
|
+
* A draft identical to the latest deployed version is refused with 409. A
|
|
443
|
+
* deployed definition is read-only, and deploying it again answers 409.
|
|
488
444
|
*
|
|
489
445
|
* @param projectId
|
|
490
446
|
* @param definitionId
|
|
491
|
-
* @
|
|
492
|
-
* @returns EvaluationResult OK
|
|
447
|
+
* @returns Definition OK
|
|
493
448
|
* @throws ApiError
|
|
494
449
|
*/
|
|
495
|
-
public
|
|
450
|
+
public deployDefinition(
|
|
496
451
|
projectId: string,
|
|
497
452
|
definitionId: string,
|
|
498
|
-
|
|
499
|
-
): CancelablePromise<Record<string, EvaluationResult>> {
|
|
453
|
+
): CancelablePromise<Definition> {
|
|
500
454
|
return this.httpRequest.request({
|
|
501
455
|
method: 'POST',
|
|
502
|
-
url: '/projects/{projectID}/dmn/definitions/{definitionID}/
|
|
456
|
+
url: '/projects/{projectID}/dmn/definitions/{definitionID}/deploy',
|
|
503
457
|
path: {
|
|
504
458
|
'projectID': projectId,
|
|
505
459
|
'definitionID': definitionId,
|
|
506
460
|
},
|
|
507
|
-
body: requestBody,
|
|
508
|
-
mediaType: 'application/json',
|
|
509
461
|
errors: {
|
|
510
462
|
400: `Bad Request`,
|
|
511
463
|
404: `Not Found`,
|
|
464
|
+
409: `Conflict`,
|
|
512
465
|
500: `Internal Server Error`,
|
|
513
466
|
},
|
|
514
467
|
});
|
|
515
468
|
}
|
|
516
469
|
/**
|
|
517
|
-
* List
|
|
518
|
-
* Returns
|
|
470
|
+
* List decisions
|
|
471
|
+
* Returns one row per deployed decision in the project, at its latest
|
|
472
|
+
* version and with the definition that version came from. Useful for
|
|
473
|
+
* picking a target decision when wiring a BPMN BusinessRuleTask.
|
|
474
|
+
*
|
|
519
475
|
* @param projectId
|
|
520
|
-
* @param definitionId
|
|
521
|
-
* @param definitionsId Filter by DMN `<definitions id>` (XML id).
|
|
522
|
-
* @param startDate Filter executions after this date (ISO 8601)
|
|
523
|
-
* @param businessId Exact-match filter on the caller-supplied correlation key.
|
|
524
476
|
* @param page Page number (1-indexed)
|
|
525
477
|
* @param pageSize Number of items per page (max 100)
|
|
526
|
-
* @
|
|
478
|
+
* @param q Optional case-insensitive substring match against decision name, decision id, or owning definition name.
|
|
479
|
+
* @returns PaginatedDecisionsResponse OK
|
|
527
480
|
* @throws ApiError
|
|
528
481
|
*/
|
|
529
|
-
public
|
|
482
|
+
public listDecisions(
|
|
530
483
|
projectId: string,
|
|
531
|
-
definitionId: string,
|
|
532
|
-
definitionsId?: string,
|
|
533
|
-
startDate?: string,
|
|
534
|
-
businessId?: string,
|
|
535
484
|
page: number = 1,
|
|
536
485
|
pageSize: number = 20,
|
|
537
|
-
|
|
486
|
+
q?: string,
|
|
487
|
+
): CancelablePromise<PaginatedDecisionsResponse> {
|
|
538
488
|
return this.httpRequest.request({
|
|
539
489
|
method: 'GET',
|
|
540
|
-
url: '/projects/{projectID}/dmn/
|
|
490
|
+
url: '/projects/{projectID}/dmn/decisions',
|
|
541
491
|
path: {
|
|
542
492
|
'projectID': projectId,
|
|
543
|
-
'definitionID': definitionId,
|
|
544
493
|
},
|
|
545
494
|
query: {
|
|
546
|
-
'definitionsID': definitionsId,
|
|
547
|
-
'startDate': startDate,
|
|
548
|
-
'businessId': businessId,
|
|
549
495
|
'page': page,
|
|
550
496
|
'pageSize': pageSize,
|
|
497
|
+
'q': q,
|
|
551
498
|
},
|
|
552
499
|
errors: {
|
|
553
|
-
400: `Bad Request`,
|
|
554
|
-
404: `Not Found`,
|
|
555
500
|
500: `Internal Server Error`,
|
|
556
501
|
},
|
|
557
502
|
});
|
|
558
503
|
}
|
|
559
504
|
/**
|
|
560
|
-
* List
|
|
561
|
-
* Returns
|
|
562
|
-
*
|
|
563
|
-
* a
|
|
505
|
+
* List a decision's deployed versions
|
|
506
|
+
* Returns every deployed version of a decision, the latest first, with
|
|
507
|
+
* the DMN definition version it came from. Decision versions count per
|
|
508
|
+
* decision id, and a BPMN BusinessRuleTask that binds a version names one
|
|
509
|
+
* of them.
|
|
564
510
|
*
|
|
565
511
|
* @param projectId
|
|
566
|
-
* @param
|
|
567
|
-
* @
|
|
568
|
-
* @param q Optional case-insensitive substring match against decision name, decision id, or owning definition name.
|
|
569
|
-
* @returns PaginatedDecisionsResponse OK
|
|
512
|
+
* @param decisionId ID of the decision node from the DMN XML.
|
|
513
|
+
* @returns DecisionVersionList OK
|
|
570
514
|
* @throws ApiError
|
|
571
515
|
*/
|
|
572
|
-
public
|
|
516
|
+
public listDecisionVersions(
|
|
573
517
|
projectId: string,
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
q?: string,
|
|
577
|
-
): CancelablePromise<PaginatedDecisionsResponse> {
|
|
518
|
+
decisionId: string,
|
|
519
|
+
): CancelablePromise<DecisionVersionList> {
|
|
578
520
|
return this.httpRequest.request({
|
|
579
521
|
method: 'GET',
|
|
580
|
-
url: '/projects/{projectID}/dmn/decisions',
|
|
522
|
+
url: '/projects/{projectID}/dmn/decisions/{decisionID}/versions',
|
|
581
523
|
path: {
|
|
582
524
|
'projectID': projectId,
|
|
583
|
-
|
|
584
|
-
query: {
|
|
585
|
-
'page': page,
|
|
586
|
-
'pageSize': pageSize,
|
|
587
|
-
'q': q,
|
|
525
|
+
'decisionID': decisionId,
|
|
588
526
|
},
|
|
589
527
|
errors: {
|
|
590
528
|
500: `Internal Server Error`,
|
|
@@ -593,9 +531,13 @@ export class DefaultService {
|
|
|
593
531
|
}
|
|
594
532
|
/**
|
|
595
533
|
* List DMN executions across the project
|
|
596
|
-
* Returns
|
|
534
|
+
* Returns the project's recorded decision evaluations, newest first:
|
|
535
|
+
* those of `EvaluateByDefinitionsID` and of business rule tasks. A test
|
|
536
|
+
* run's evaluations are left out.
|
|
537
|
+
*
|
|
597
538
|
* @param projectId
|
|
598
539
|
* @param definitionsId Filter by DMN `<definitions id>` (XML id).
|
|
540
|
+
* @param version Only evaluations of this deployed version of `definitionsID`. Ignored without `definitionsID`.
|
|
599
541
|
* @param businessId Exact-match filter on the caller-supplied correlation key.
|
|
600
542
|
* @param startDate Only return executions at or after this instant (ISO 8601). Bounds the scan and the reported total; omit for the full unbounded history.
|
|
601
543
|
* @param page Page number (1-indexed)
|
|
@@ -606,6 +548,7 @@ export class DefaultService {
|
|
|
606
548
|
public listProjectExecutions(
|
|
607
549
|
projectId: string,
|
|
608
550
|
definitionsId?: string,
|
|
551
|
+
version?: number,
|
|
609
552
|
businessId?: string,
|
|
610
553
|
startDate?: string,
|
|
611
554
|
page: number = 1,
|
|
@@ -619,6 +562,7 @@ export class DefaultService {
|
|
|
619
562
|
},
|
|
620
563
|
query: {
|
|
621
564
|
'definitionsID': definitionsId,
|
|
565
|
+
'version': version,
|
|
622
566
|
'businessId': businessId,
|
|
623
567
|
'startDate': startDate,
|
|
624
568
|
'page': page,
|
|
@@ -633,7 +577,7 @@ export class DefaultService {
|
|
|
633
577
|
}
|
|
634
578
|
/**
|
|
635
579
|
* Get a single DMN execution
|
|
636
|
-
* Returns the inputs
|
|
580
|
+
* Returns the inputs and per-decision results of a single recorded evaluation.
|
|
637
581
|
* @param projectId
|
|
638
582
|
* @param executionId
|
|
639
583
|
* @returns Execution OK
|
|
@@ -659,9 +603,8 @@ export class DefaultService {
|
|
|
659
603
|
}
|
|
660
604
|
/**
|
|
661
605
|
* List BPMN instances
|
|
662
|
-
* Returns paginated process instances in the project, optionally filtered by
|
|
606
|
+
* Returns paginated process instances in the project, optionally filtered by process, version or status.
|
|
663
607
|
* @param projectId
|
|
664
|
-
* @param definitionId
|
|
665
608
|
* @param status
|
|
666
609
|
* @param hasIncident Filter by whether the instance has at least one unresolved incident.
|
|
667
610
|
* Omit to return all instances regardless of incident status; pass
|
|
@@ -676,26 +619,33 @@ export class DefaultService {
|
|
|
676
619
|
* at a time.
|
|
677
620
|
*
|
|
678
621
|
* @param createdAfter Only return instances created at or after this timestamp. Strongly
|
|
679
|
-
* recommended for monitoring views -
|
|
680
|
-
*
|
|
622
|
+
* recommended for monitoring views - ended instances stay until
|
|
623
|
+
* retention deletes them, and unfiltered queries grow linearly with
|
|
681
624
|
* that history.
|
|
682
625
|
*
|
|
683
|
-
* @param businessId
|
|
684
|
-
* @param
|
|
685
|
-
* @param
|
|
626
|
+
* @param businessId Prefix match on the caller-supplied correlation key set at start time.
|
|
627
|
+
* @param processId Only instances of this process id, in any version unless `version` names one.
|
|
628
|
+
* @param version Only instances of this version of `processId`. Ignored without `processId`.
|
|
629
|
+
* @param draft `true` keeps only test runs (see `StartBpmnTestInstance`), `false`
|
|
630
|
+
* leaves them out. Omit for both.
|
|
631
|
+
*
|
|
632
|
+
* @param cursor The `nextCursor` of the page before, absent for the first page.
|
|
633
|
+
* @param limit Most instances per page, 20 by default and 100 at most.
|
|
686
634
|
* @returns BpmnInstancePaginatedResponse OK
|
|
687
635
|
* @throws ApiError
|
|
688
636
|
*/
|
|
689
637
|
public listBpmnInstances(
|
|
690
638
|
projectId: string,
|
|
691
|
-
|
|
692
|
-
status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELED',
|
|
639
|
+
status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELED' | 'TERMINATED',
|
|
693
640
|
hasIncident?: boolean,
|
|
694
641
|
suspended?: boolean,
|
|
695
642
|
createdAfter?: string,
|
|
696
643
|
businessId?: string,
|
|
697
|
-
|
|
698
|
-
|
|
644
|
+
processId?: string,
|
|
645
|
+
version?: number,
|
|
646
|
+
draft?: boolean,
|
|
647
|
+
cursor?: string,
|
|
648
|
+
limit?: number,
|
|
699
649
|
): CancelablePromise<BpmnInstancePaginatedResponse> {
|
|
700
650
|
return this.httpRequest.request({
|
|
701
651
|
method: 'GET',
|
|
@@ -704,22 +654,29 @@ export class DefaultService {
|
|
|
704
654
|
'projectID': projectId,
|
|
705
655
|
},
|
|
706
656
|
query: {
|
|
707
|
-
'definitionID': definitionId,
|
|
708
657
|
'status': status,
|
|
709
658
|
'hasIncident': hasIncident,
|
|
710
659
|
'suspended': suspended,
|
|
711
660
|
'createdAfter': createdAfter,
|
|
712
661
|
'businessId': businessId,
|
|
713
|
-
'
|
|
714
|
-
'
|
|
662
|
+
'processId': processId,
|
|
663
|
+
'version': version,
|
|
664
|
+
'draft': draft,
|
|
665
|
+
'cursor': cursor,
|
|
666
|
+
'limit': limit,
|
|
715
667
|
},
|
|
716
668
|
});
|
|
717
669
|
}
|
|
718
670
|
/**
|
|
719
671
|
* Start a BPMN process instance
|
|
720
|
-
* Starts a new instance of a deployed BPMN process
|
|
721
|
-
*
|
|
722
|
-
* state, send signals/messages, complete user
|
|
672
|
+
* Starts a new instance of a deployed BPMN process, the latest version
|
|
673
|
+
* unless the request names one. The returned `instanceID` addresses the
|
|
674
|
+
* instance - use it to fetch state, send signals/messages, complete user
|
|
675
|
+
* tasks, etc.
|
|
676
|
+
*
|
|
677
|
+
* A process with no deployed version, or without the requested one,
|
|
678
|
+
* answers 404, also when it exists in a resource that is not deployed yet.
|
|
679
|
+
* Drafts only start test instances, see `StartBpmnTestInstance`.
|
|
723
680
|
*
|
|
724
681
|
* @param projectId
|
|
725
682
|
* @param requestBody
|
|
@@ -731,9 +688,9 @@ export class DefaultService {
|
|
|
731
688
|
requestBody: StartBpmnInstanceRequest,
|
|
732
689
|
): CancelablePromise<{
|
|
733
690
|
/**
|
|
734
|
-
*
|
|
691
|
+
* Identifier of the new instance.
|
|
735
692
|
*/
|
|
736
|
-
|
|
693
|
+
instanceID?: string;
|
|
737
694
|
}> {
|
|
738
695
|
return this.httpRequest.request({
|
|
739
696
|
method: 'POST',
|
|
@@ -746,32 +703,35 @@ export class DefaultService {
|
|
|
746
703
|
errors: {
|
|
747
704
|
400: `Bad Request`,
|
|
748
705
|
401: `Unauthorized`,
|
|
706
|
+
404: `Not Found`,
|
|
749
707
|
500: `Internal Server Error`,
|
|
750
708
|
},
|
|
751
709
|
});
|
|
752
710
|
}
|
|
753
711
|
/**
|
|
754
712
|
* Get BPMN instance state
|
|
755
|
-
* Returns the
|
|
756
|
-
*
|
|
757
|
-
*
|
|
758
|
-
* instance.
|
|
713
|
+
* Returns the runtime state of a process instance - current variables,
|
|
714
|
+
* active scopes, and any unresolved incidents. Its history is paged
|
|
715
|
+
* separately, see `GetBpmnInstanceHistory`.
|
|
759
716
|
*
|
|
760
717
|
* @param projectId
|
|
761
|
-
* @param
|
|
718
|
+
* @param instanceId
|
|
762
719
|
* @returns BpmnInstanceState OK
|
|
763
720
|
* @throws ApiError
|
|
764
721
|
*/
|
|
765
722
|
public getBpmnInstance(
|
|
766
723
|
projectId: string,
|
|
767
|
-
|
|
724
|
+
instanceId: string,
|
|
768
725
|
): CancelablePromise<BpmnInstanceState> {
|
|
769
726
|
return this.httpRequest.request({
|
|
770
727
|
method: 'GET',
|
|
771
|
-
url: '/projects/{projectID}/bpmn/instances/{
|
|
728
|
+
url: '/projects/{projectID}/bpmn/instances/{instanceID}',
|
|
772
729
|
path: {
|
|
773
730
|
'projectID': projectId,
|
|
774
|
-
'
|
|
731
|
+
'instanceID': instanceId,
|
|
732
|
+
},
|
|
733
|
+
errors: {
|
|
734
|
+
404: `Not Found`,
|
|
775
735
|
},
|
|
776
736
|
});
|
|
777
737
|
}
|
|
@@ -781,43 +741,48 @@ export class DefaultService {
|
|
|
781
741
|
* child instances. Cancellation is best-effort - handlers in flight may
|
|
782
742
|
* still complete before the cancel propagates. Cancelled instances move
|
|
783
743
|
* to status `CANCELED` and stop consuming further work.
|
|
744
|
+
* The cancel is recorded in the instance's history as a
|
|
745
|
+
* `CancelInstanceEvent` naming who cancelled it.
|
|
784
746
|
*
|
|
785
747
|
* @param projectId
|
|
786
|
-
* @param
|
|
748
|
+
* @param instanceId
|
|
787
749
|
* @returns void
|
|
788
750
|
* @throws ApiError
|
|
789
751
|
*/
|
|
790
752
|
public cancelBpmnInstance(
|
|
791
753
|
projectId: string,
|
|
792
|
-
|
|
754
|
+
instanceId: string,
|
|
793
755
|
): CancelablePromise<void> {
|
|
794
756
|
return this.httpRequest.request({
|
|
795
757
|
method: 'DELETE',
|
|
796
|
-
url: '/projects/{projectID}/bpmn/instances/{
|
|
758
|
+
url: '/projects/{projectID}/bpmn/instances/{instanceID}',
|
|
797
759
|
path: {
|
|
798
760
|
'projectID': projectId,
|
|
799
|
-
'
|
|
761
|
+
'instanceID': instanceId,
|
|
762
|
+
},
|
|
763
|
+
errors: {
|
|
764
|
+
400: `The instance is a call-activity child of a running instance. Cancel the root instance instead.`,
|
|
765
|
+
404: `No instance has this ID.`,
|
|
800
766
|
},
|
|
801
767
|
});
|
|
802
768
|
}
|
|
803
769
|
/**
|
|
804
770
|
* List external jobs
|
|
805
771
|
* Returns paginated external jobs in the project, with optional filters
|
|
806
|
-
* by `taskType`, `status`, and originating instance.
|
|
807
|
-
*
|
|
808
|
-
*
|
|
772
|
+
* by `taskType`, `status`, and originating instance. The list holds the
|
|
773
|
+
* pending jobs and the finished jobs of running instances. An instance's
|
|
774
|
+
* jobs leave the list when it ends, and its history keeps each job's task
|
|
775
|
+
* type, retries left and worker. For pulling pending work as a job
|
|
776
|
+
* worker, use `Poll` instead.
|
|
809
777
|
*
|
|
810
778
|
* @param projectId
|
|
811
779
|
* @param taskType Filter jobs by task type
|
|
812
780
|
* @param status Filter jobs by status
|
|
813
|
-
* @param
|
|
814
|
-
* @param businessId
|
|
815
|
-
* @param createdAfter Only return jobs created at or after this timestamp.
|
|
816
|
-
*
|
|
817
|
-
*
|
|
818
|
-
*
|
|
819
|
-
* @param page
|
|
820
|
-
* @param pageSize
|
|
781
|
+
* @param instanceId Only this instance's jobs. A test run's jobs list only by its instance.
|
|
782
|
+
* @param businessId Prefix match on the caller-supplied correlation key.
|
|
783
|
+
* @param createdAfter Only return jobs created at or after this timestamp.
|
|
784
|
+
* @param cursor The `nextCursor` of the page before, absent for the first page.
|
|
785
|
+
* @param limit Most jobs per page, 20 by default and 100 at most.
|
|
821
786
|
* @returns BpmnExternalJobPaginatedResponse OK
|
|
822
787
|
* @throws ApiError
|
|
823
788
|
*/
|
|
@@ -825,11 +790,11 @@ export class DefaultService {
|
|
|
825
790
|
projectId: string,
|
|
826
791
|
taskType?: string,
|
|
827
792
|
status?: 'PENDING' | 'COMPLETED' | 'FAILED' | 'CANCELED',
|
|
828
|
-
|
|
793
|
+
instanceId?: string,
|
|
829
794
|
businessId?: string,
|
|
830
795
|
createdAfter?: string,
|
|
831
|
-
|
|
832
|
-
|
|
796
|
+
cursor?: string,
|
|
797
|
+
limit?: number,
|
|
833
798
|
): CancelablePromise<BpmnExternalJobPaginatedResponse> {
|
|
834
799
|
return this.httpRequest.request({
|
|
835
800
|
method: 'GET',
|
|
@@ -840,11 +805,11 @@ export class DefaultService {
|
|
|
840
805
|
query: {
|
|
841
806
|
'taskType': taskType,
|
|
842
807
|
'status': status,
|
|
843
|
-
'
|
|
808
|
+
'instanceID': instanceId,
|
|
844
809
|
'businessId': businessId,
|
|
845
810
|
'createdAfter': createdAfter,
|
|
846
|
-
'
|
|
847
|
-
'
|
|
811
|
+
'cursor': cursor,
|
|
812
|
+
'limit': limit,
|
|
848
813
|
},
|
|
849
814
|
});
|
|
850
815
|
}
|
|
@@ -852,9 +817,11 @@ export class DefaultService {
|
|
|
852
817
|
* Poll for external jobs (long-poll)
|
|
853
818
|
* Long-polls for PENDING jobs of a given `taskType`. Returns a batch of
|
|
854
819
|
* jobs (up to `maxJobs`) as soon as any are available, or `204 No Content`
|
|
855
|
-
* when the timeout elapses with no work. Each returned job is
|
|
856
|
-
*
|
|
857
|
-
* the
|
|
820
|
+
* when the timeout elapses with no work. Each returned job is locked to
|
|
821
|
+
* the caller until `lockDuration` passes without a `Heartbeat`, and for at
|
|
822
|
+
* most the server's `ENGINE_JOB_MAX_HOLD` (30m by default) in total. Finish
|
|
823
|
+
* with `Complete` or `ThrowError`. A lock that runs out costs the job a
|
|
824
|
+
* retry, and with no retries left it raises an incident.
|
|
858
825
|
*
|
|
859
826
|
* @param projectId
|
|
860
827
|
* @param requestBody
|
|
@@ -873,14 +840,18 @@ export class DefaultService {
|
|
|
873
840
|
},
|
|
874
841
|
body: requestBody,
|
|
875
842
|
mediaType: 'application/json',
|
|
843
|
+
errors: {
|
|
844
|
+
400: `An empty \`clientID\`, or a \`lockDuration\` or \`timeout\` that is not a Go duration.`,
|
|
845
|
+
},
|
|
876
846
|
});
|
|
877
847
|
}
|
|
878
848
|
/**
|
|
879
849
|
* Extend the lock on an acquired job
|
|
880
|
-
*
|
|
881
|
-
*
|
|
882
|
-
*
|
|
883
|
-
*
|
|
850
|
+
* Keeps the caller's lock on a job it acquired via `Poll` for another
|
|
851
|
+
* `lockDuration`, up to `ENGINE_JOB_MAX_HOLD` after the job was handed out.
|
|
852
|
+
* SDK workers send it at half of the lock the poll granted
|
|
853
|
+
* (`lockExpiresAt`) while a handler runs.
|
|
854
|
+
* Other workers cannot claim the job while the lock holds.
|
|
884
855
|
*
|
|
885
856
|
* @param projectId
|
|
886
857
|
* @param executionKey
|
|
@@ -909,7 +880,12 @@ export class DefaultService {
|
|
|
909
880
|
body: requestBody,
|
|
910
881
|
mediaType: 'application/json',
|
|
911
882
|
errors: {
|
|
912
|
-
|
|
883
|
+
400: `An empty \`clientID\`, or a \`lockDuration\` that is not a Go duration.`,
|
|
884
|
+
404: `No job has this execution key, or its instance has ended. Stop working on it.`,
|
|
885
|
+
409: `This worker no longer holds the job. Its lock ran out, another
|
|
886
|
+
worker holds it, or the job has finished. Stop working on it. The
|
|
887
|
+
message says when the job was cancelled.
|
|
888
|
+
`,
|
|
913
889
|
},
|
|
914
890
|
});
|
|
915
891
|
}
|
|
@@ -918,7 +894,9 @@ export class DefaultService {
|
|
|
918
894
|
* Finalizes an acquired external job successfully. The supplied
|
|
919
895
|
* `variables` are merged into the originating instance's scope and the
|
|
920
896
|
* process resumes after the service task. Idempotent on the executionKey:
|
|
921
|
-
* a second call with the same key after success is a no-op.
|
|
897
|
+
* a second call with the same key after success is a no-op. Once the
|
|
898
|
+
* instance has ended, any report on its jobs answers 200 and changes
|
|
899
|
+
* nothing.
|
|
922
900
|
*
|
|
923
901
|
* @param projectId
|
|
924
902
|
* @param executionKey
|
|
@@ -931,15 +909,17 @@ export class DefaultService {
|
|
|
931
909
|
executionKey: string,
|
|
932
910
|
requestBody: {
|
|
933
911
|
/**
|
|
934
|
-
*
|
|
912
|
+
* Instance ID returned by the poll response.
|
|
935
913
|
*/
|
|
936
|
-
|
|
914
|
+
instanceID: string;
|
|
937
915
|
/**
|
|
938
916
|
* Optional worker identity (the same `clientID` used to poll).
|
|
939
|
-
* When supplied,
|
|
940
|
-
*
|
|
941
|
-
*
|
|
942
|
-
*
|
|
917
|
+
* When supplied, a worker that no longer holds the job's lock
|
|
918
|
+
* gets 409 and its result is discarded. Repeating the report
|
|
919
|
+
* this worker last made on the job answers 200 again and changes
|
|
920
|
+
* nothing. Without it, the completion applies to an open job no
|
|
921
|
+
* worker holds a live lock on, as a completion from the console
|
|
922
|
+
* does.
|
|
943
923
|
*
|
|
944
924
|
*/
|
|
945
925
|
clientID?: string;
|
|
@@ -955,6 +935,15 @@ export class DefaultService {
|
|
|
955
935
|
},
|
|
956
936
|
body: requestBody,
|
|
957
937
|
mediaType: 'application/json',
|
|
938
|
+
errors: {
|
|
939
|
+
404: `The instance is running and has no job with this execution key.`,
|
|
940
|
+
409: `The result was discarded. This worker no longer holds the job: its
|
|
941
|
+
lock ran out, another worker holds or completed it, or the job
|
|
942
|
+
failed or was cancelled. Without a \`clientID\`, a worker holds a live
|
|
943
|
+
lock on the job, named in the message, or the job already ended. The
|
|
944
|
+
message says when it was cancelled.
|
|
945
|
+
`,
|
|
946
|
+
},
|
|
958
947
|
});
|
|
959
948
|
}
|
|
960
949
|
}
|