@quantumbpm/sdk 1.3.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 +57 -34
- package/dist/auth.d.ts +19 -14
- package/dist/auth.js +62 -84
- package/dist/bpmn.d.ts +81 -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 +8 -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 +11 -17
- package/dist/generated/models/BpmnIncident.js +7 -11
- package/dist/generated/models/BpmnIncidentRecord.d.ts +7 -13
- package/dist/generated/models/BpmnIncidentRecord.js +4 -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 +14 -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 +31 -14
- 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/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 +4 -4
- package/dist/generated/models/Error.js +3 -3
- package/dist/generated/models/EvaluateStoredRequest.d.ts +5 -6
- 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 +8 -8
- package/dist/generated/models/ExternalJob.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/UpdateDefinitionRequest.d.ts +1 -5
- package/dist/generated/models/UpdateDefinitionRequest.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 +183 -87
- package/dist/generated/services/BpmnService.js +267 -121
- package/dist/generated/services/DefaultService.d.ts +106 -113
- package/dist/generated/services/DefaultService.js +127 -164
- package/dist/index.d.ts +8 -8
- package/dist/index.js +7 -7
- package/dist/tracing.js +2 -2
- package/dist/workers.d.ts +2 -2
- package/dist/workers.js +4 -3
- package/package.json +2 -4
- package/src/auth.test.ts +128 -0
- package/src/auth.ts +67 -64
- package/src/bpmn.ts +128 -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 +8 -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 +11 -17
- package/src/generated/models/BpmnIncidentRecord.ts +7 -13
- package/src/generated/models/BpmnIncidentRecordPaginatedResponse.ts +2 -2
- package/src/generated/models/BpmnInstance.ts +14 -29
- package/src/generated/models/BpmnInstancePaginatedResponse.ts +2 -2
- package/src/generated/models/BpmnInstanceState.ts +31 -14
- 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/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 +4 -4
- package/src/generated/models/EvaluateStoredRequest.ts +5 -6
- package/src/generated/models/EvaluationResult.ts +6 -0
- package/src/generated/models/Execution.ts +30 -9
- package/src/generated/models/ExternalJob.ts +8 -8
- package/src/generated/models/StartBpmnInstanceRequest.ts +6 -2
- package/src/generated/models/SuspendBpmnInstanceRequest.ts +1 -1
- package/src/generated/models/UpdateDefinitionRequest.ts +1 -5
- package/src/generated/models/UserTask.ts +15 -11
- package/src/generated/services/BpmnService.ts +320 -137
- package/src/generated/services/DefaultService.ts +147 -192
- package/src/index.test.ts +74 -31
- package/src/index.ts +13 -6
- package/src/tracing.ts +1 -1
- package/src/workers.test.ts +2 -3
- package/src/workers.ts +5 -4
- 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,28 +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
626
|
* @param businessId Prefix match on the caller-supplied correlation key set at start time.
|
|
684
|
-
* @param processId Only instances of this process id, in any version
|
|
685
|
-
* @param
|
|
686
|
-
* @param
|
|
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.
|
|
687
634
|
* @returns BpmnInstancePaginatedResponse OK
|
|
688
635
|
* @throws ApiError
|
|
689
636
|
*/
|
|
690
637
|
public listBpmnInstances(
|
|
691
638
|
projectId: string,
|
|
692
|
-
|
|
693
|
-
status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELED' | 'TERMINATED' | 'TIMED_OUT',
|
|
639
|
+
status?: 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELED' | 'TERMINATED',
|
|
694
640
|
hasIncident?: boolean,
|
|
695
641
|
suspended?: boolean,
|
|
696
642
|
createdAfter?: string,
|
|
697
643
|
businessId?: string,
|
|
698
644
|
processId?: string,
|
|
699
|
-
|
|
700
|
-
|
|
645
|
+
version?: number,
|
|
646
|
+
draft?: boolean,
|
|
647
|
+
cursor?: string,
|
|
648
|
+
limit?: number,
|
|
701
649
|
): CancelablePromise<BpmnInstancePaginatedResponse> {
|
|
702
650
|
return this.httpRequest.request({
|
|
703
651
|
method: 'GET',
|
|
@@ -706,26 +654,29 @@ export class DefaultService {
|
|
|
706
654
|
'projectID': projectId,
|
|
707
655
|
},
|
|
708
656
|
query: {
|
|
709
|
-
'definitionID': definitionId,
|
|
710
657
|
'status': status,
|
|
711
658
|
'hasIncident': hasIncident,
|
|
712
659
|
'suspended': suspended,
|
|
713
660
|
'createdAfter': createdAfter,
|
|
714
661
|
'businessId': businessId,
|
|
715
662
|
'processId': processId,
|
|
716
|
-
'
|
|
717
|
-
'
|
|
663
|
+
'version': version,
|
|
664
|
+
'draft': draft,
|
|
665
|
+
'cursor': cursor,
|
|
666
|
+
'limit': limit,
|
|
718
667
|
},
|
|
719
668
|
});
|
|
720
669
|
}
|
|
721
670
|
/**
|
|
722
671
|
* Start a BPMN process instance
|
|
723
|
-
* Starts a new instance of a deployed BPMN process
|
|
724
|
-
*
|
|
725
|
-
* 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.
|
|
726
676
|
*
|
|
727
|
-
* A process
|
|
728
|
-
*
|
|
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`.
|
|
729
680
|
*
|
|
730
681
|
* @param projectId
|
|
731
682
|
* @param requestBody
|
|
@@ -737,9 +688,9 @@ export class DefaultService {
|
|
|
737
688
|
requestBody: StartBpmnInstanceRequest,
|
|
738
689
|
): CancelablePromise<{
|
|
739
690
|
/**
|
|
740
|
-
*
|
|
691
|
+
* Identifier of the new instance.
|
|
741
692
|
*/
|
|
742
|
-
|
|
693
|
+
instanceID?: string;
|
|
743
694
|
}> {
|
|
744
695
|
return this.httpRequest.request({
|
|
745
696
|
method: 'POST',
|
|
@@ -759,31 +710,28 @@ export class DefaultService {
|
|
|
759
710
|
}
|
|
760
711
|
/**
|
|
761
712
|
* Get BPMN instance state
|
|
762
|
-
* Returns the
|
|
763
|
-
*
|
|
764
|
-
*
|
|
765
|
-
* 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`.
|
|
766
716
|
*
|
|
767
717
|
* @param projectId
|
|
768
|
-
* @param
|
|
718
|
+
* @param instanceId
|
|
769
719
|
* @returns BpmnInstanceState OK
|
|
770
720
|
* @throws ApiError
|
|
771
721
|
*/
|
|
772
722
|
public getBpmnInstance(
|
|
773
723
|
projectId: string,
|
|
774
|
-
|
|
724
|
+
instanceId: string,
|
|
775
725
|
): CancelablePromise<BpmnInstanceState> {
|
|
776
726
|
return this.httpRequest.request({
|
|
777
727
|
method: 'GET',
|
|
778
|
-
url: '/projects/{projectID}/bpmn/instances/{
|
|
728
|
+
url: '/projects/{projectID}/bpmn/instances/{instanceID}',
|
|
779
729
|
path: {
|
|
780
730
|
'projectID': projectId,
|
|
781
|
-
'
|
|
731
|
+
'instanceID': instanceId,
|
|
782
732
|
},
|
|
783
733
|
errors: {
|
|
784
|
-
|
|
785
|
-
while Temporal retries a workflow task that timed out. Try again shortly.
|
|
786
|
-
`,
|
|
734
|
+
404: `Not Found`,
|
|
787
735
|
},
|
|
788
736
|
});
|
|
789
737
|
}
|
|
@@ -793,47 +741,48 @@ export class DefaultService {
|
|
|
793
741
|
* child instances. Cancellation is best-effort - handlers in flight may
|
|
794
742
|
* still complete before the cancel propagates. Cancelled instances move
|
|
795
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.
|
|
796
746
|
*
|
|
797
747
|
* @param projectId
|
|
798
|
-
* @param
|
|
748
|
+
* @param instanceId
|
|
799
749
|
* @returns void
|
|
800
750
|
* @throws ApiError
|
|
801
751
|
*/
|
|
802
752
|
public cancelBpmnInstance(
|
|
803
753
|
projectId: string,
|
|
804
|
-
|
|
754
|
+
instanceId: string,
|
|
805
755
|
): CancelablePromise<void> {
|
|
806
756
|
return this.httpRequest.request({
|
|
807
757
|
method: 'DELETE',
|
|
808
|
-
url: '/projects/{projectID}/bpmn/instances/{
|
|
758
|
+
url: '/projects/{projectID}/bpmn/instances/{instanceID}',
|
|
809
759
|
path: {
|
|
810
760
|
'projectID': projectId,
|
|
811
|
-
'
|
|
761
|
+
'instanceID': instanceId,
|
|
812
762
|
},
|
|
813
763
|
errors: {
|
|
814
764
|
400: `The instance is a call-activity child of a running instance. Cancel the root instance instead.`,
|
|
815
|
-
404: `No instance has this
|
|
765
|
+
404: `No instance has this ID.`,
|
|
816
766
|
},
|
|
817
767
|
});
|
|
818
768
|
}
|
|
819
769
|
/**
|
|
820
770
|
* List external jobs
|
|
821
771
|
* Returns paginated external jobs in the project, with optional filters
|
|
822
|
-
* by `taskType`, `status`, and originating instance.
|
|
823
|
-
*
|
|
824
|
-
*
|
|
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.
|
|
825
777
|
*
|
|
826
778
|
* @param projectId
|
|
827
779
|
* @param taskType Filter jobs by task type
|
|
828
780
|
* @param status Filter jobs by status
|
|
829
|
-
* @param
|
|
781
|
+
* @param instanceId Only this instance's jobs. A test run's jobs list only by its instance.
|
|
830
782
|
* @param businessId Prefix match on the caller-supplied correlation key.
|
|
831
|
-
* @param createdAfter Only return jobs created at or after this timestamp.
|
|
832
|
-
*
|
|
833
|
-
*
|
|
834
|
-
*
|
|
835
|
-
* @param page
|
|
836
|
-
* @param pageSize
|
|
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.
|
|
837
786
|
* @returns BpmnExternalJobPaginatedResponse OK
|
|
838
787
|
* @throws ApiError
|
|
839
788
|
*/
|
|
@@ -841,11 +790,11 @@ export class DefaultService {
|
|
|
841
790
|
projectId: string,
|
|
842
791
|
taskType?: string,
|
|
843
792
|
status?: 'PENDING' | 'COMPLETED' | 'FAILED' | 'CANCELED',
|
|
844
|
-
|
|
793
|
+
instanceId?: string,
|
|
845
794
|
businessId?: string,
|
|
846
795
|
createdAfter?: string,
|
|
847
|
-
|
|
848
|
-
|
|
796
|
+
cursor?: string,
|
|
797
|
+
limit?: number,
|
|
849
798
|
): CancelablePromise<BpmnExternalJobPaginatedResponse> {
|
|
850
799
|
return this.httpRequest.request({
|
|
851
800
|
method: 'GET',
|
|
@@ -856,11 +805,11 @@ export class DefaultService {
|
|
|
856
805
|
query: {
|
|
857
806
|
'taskType': taskType,
|
|
858
807
|
'status': status,
|
|
859
|
-
'
|
|
808
|
+
'instanceID': instanceId,
|
|
860
809
|
'businessId': businessId,
|
|
861
810
|
'createdAfter': createdAfter,
|
|
862
|
-
'
|
|
863
|
-
'
|
|
811
|
+
'cursor': cursor,
|
|
812
|
+
'limit': limit,
|
|
864
813
|
},
|
|
865
814
|
});
|
|
866
815
|
}
|
|
@@ -870,7 +819,7 @@ export class DefaultService {
|
|
|
870
819
|
* jobs (up to `maxJobs`) as soon as any are available, or `204 No Content`
|
|
871
820
|
* when the timeout elapses with no work. Each returned job is locked to
|
|
872
821
|
* the caller until `lockDuration` passes without a `Heartbeat`, and for at
|
|
873
|
-
* most the server's `
|
|
822
|
+
* most the server's `ENGINE_JOB_MAX_HOLD` (30m by default) in total. Finish
|
|
874
823
|
* with `Complete` or `ThrowError`. A lock that runs out costs the job a
|
|
875
824
|
* retry, and with no retries left it raises an incident.
|
|
876
825
|
*
|
|
@@ -899,7 +848,7 @@ export class DefaultService {
|
|
|
899
848
|
/**
|
|
900
849
|
* Extend the lock on an acquired job
|
|
901
850
|
* Keeps the caller's lock on a job it acquired via `Poll` for another
|
|
902
|
-
* `lockDuration`, up to `
|
|
851
|
+
* `lockDuration`, up to `ENGINE_JOB_MAX_HOLD` after the job was handed out.
|
|
903
852
|
* SDK workers send it at half of the lock the poll granted
|
|
904
853
|
* (`lockExpiresAt`) while a handler runs.
|
|
905
854
|
* Other workers cannot claim the job while the lock holds.
|
|
@@ -932,7 +881,7 @@ export class DefaultService {
|
|
|
932
881
|
mediaType: 'application/json',
|
|
933
882
|
errors: {
|
|
934
883
|
400: `An empty \`clientID\`, or a \`lockDuration\` that is not a Go duration.`,
|
|
935
|
-
404: `No job has this execution key.`,
|
|
884
|
+
404: `No job has this execution key, or its instance has ended. Stop working on it.`,
|
|
936
885
|
409: `This worker no longer holds the job. Its lock ran out, another
|
|
937
886
|
worker holds it, or the job has finished. Stop working on it. The
|
|
938
887
|
message says when the job was cancelled.
|
|
@@ -945,7 +894,9 @@ export class DefaultService {
|
|
|
945
894
|
* Finalizes an acquired external job successfully. The supplied
|
|
946
895
|
* `variables` are merged into the originating instance's scope and the
|
|
947
896
|
* process resumes after the service task. Idempotent on the executionKey:
|
|
948
|
-
* 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.
|
|
949
900
|
*
|
|
950
901
|
* @param projectId
|
|
951
902
|
* @param executionKey
|
|
@@ -958,15 +909,17 @@ export class DefaultService {
|
|
|
958
909
|
executionKey: string,
|
|
959
910
|
requestBody: {
|
|
960
911
|
/**
|
|
961
|
-
*
|
|
912
|
+
* Instance ID returned by the poll response.
|
|
962
913
|
*/
|
|
963
|
-
|
|
914
|
+
instanceID: string;
|
|
964
915
|
/**
|
|
965
916
|
* Optional worker identity (the same `clientID` used to poll).
|
|
966
917
|
* When supplied, a worker that no longer holds the job's lock
|
|
967
|
-
* gets 409 and its result is discarded.
|
|
968
|
-
* worker
|
|
969
|
-
*
|
|
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.
|
|
970
923
|
*
|
|
971
924
|
*/
|
|
972
925
|
clientID?: string;
|
|
@@ -983,10 +936,12 @@ export class DefaultService {
|
|
|
983
936
|
body: requestBody,
|
|
984
937
|
mediaType: 'application/json',
|
|
985
938
|
errors: {
|
|
986
|
-
404: `
|
|
987
|
-
409: `This worker no longer holds the job
|
|
988
|
-
|
|
989
|
-
failed or was cancelled.
|
|
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.
|
|
990
945
|
`,
|
|
991
946
|
},
|
|
992
947
|
});
|