bpmn-elements 11.1.1 → 13.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/CHANGELOG.md +14 -0
- package/dist/Environment.js +15 -15
- package/dist/activity/Activity.js +123 -143
- package/dist/activity/ActivityExecution.js +1 -3
- package/dist/definition/Definition.js +39 -44
- package/dist/definition/DefinitionExecution.js +51 -53
- package/dist/eventDefinitions/EventDefinitionExecution.js +10 -10
- package/dist/eventDefinitions/TimerEventDefinition.js +16 -16
- package/dist/events/BoundaryEvent.js +12 -11
- package/dist/events/index.js +60 -0
- package/dist/flows/Association.js +0 -1
- package/dist/flows/MessageFlow.js +0 -1
- package/dist/flows/SequenceFlow.js +1 -3
- package/dist/gateways/index.js +49 -0
- package/dist/getPropertyValue.js +1 -2
- package/dist/index.js +2 -2
- package/dist/process/Process.js +54 -61
- package/dist/process/ProcessExecution.js +31 -33
- package/dist/tasks/LoopCharacteristics.js +20 -7
- package/dist/tasks/SubProcess.js +33 -61
- package/dist/tasks/index.js +93 -0
- package/events.d.ts +1 -0
- package/gateways.d.ts +1 -0
- package/index.d.ts +1 -0
- package/package.json +39 -19
- package/src/Environment.js +16 -17
- package/src/activity/Activity.js +96 -131
- package/src/activity/ActivityExecution.js +0 -1
- package/src/definition/Definition.js +30 -40
- package/src/definition/DefinitionExecution.js +47 -55
- package/src/eventDefinitions/EventDefinitionExecution.js +9 -10
- package/src/eventDefinitions/TimerEventDefinition.js +14 -16
- package/src/events/BoundaryEvent.js +11 -11
- package/src/events/index.js +5 -0
- package/src/flows/Association.js +0 -1
- package/src/flows/MessageFlow.js +0 -1
- package/src/flows/SequenceFlow.js +0 -1
- package/src/gateways/index.js +4 -0
- package/src/process/Process.js +40 -54
- package/src/process/ProcessExecution.js +25 -31
- package/src/tasks/LoopCharacteristics.js +18 -7
- package/src/tasks/SubProcess.js +32 -66
- package/src/tasks/index.js +8 -0
- package/tasks.d.ts +1 -0
- package/types/index.d.ts +69 -767
- package/types/types.d.ts +706 -0
package/types/index.d.ts
CHANGED
|
@@ -1,708 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { BrokerState } from 'smqp/types/Broker';
|
|
4
|
-
import { Consumer } from 'smqp/types/Queue';
|
|
5
|
-
import { MessageMessage, MessageFields, MessageProperties } from 'smqp/types/Message';
|
|
6
|
-
import { SerializableContext, SerializableElement } from 'moddle-context-serializer';
|
|
7
|
-
|
|
8
|
-
interface ElementBroker<T> extends Broker {
|
|
9
|
-
get owner(): T;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
type signalMessage = {
|
|
13
|
-
/**
|
|
14
|
-
* Optional signal id
|
|
15
|
-
* - Activity id
|
|
16
|
-
* - Signal-, Message-, Escalation id, etc
|
|
17
|
-
*/
|
|
18
|
-
id?: string,
|
|
19
|
-
/**
|
|
20
|
-
* Optional execution id
|
|
21
|
-
* e.g. excutionId of a parallel multi instance user task
|
|
22
|
-
*/
|
|
23
|
-
executionId?: string,
|
|
24
|
-
/** Any other input that will be added to completed activity output */
|
|
25
|
-
[x: string]: any,
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface ElementMessageContent {
|
|
29
|
-
id?: string;
|
|
30
|
-
type?: string;
|
|
31
|
-
executionId?: string;
|
|
32
|
-
parent?: ElementParent;
|
|
33
|
-
[x: string]: any;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
interface ElementBrokerMessage extends MessageMessage {
|
|
37
|
-
content: ElementMessageContent,
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
class EventDefinition {
|
|
41
|
-
constructor(activity: Activity, eventDefinitionElement: SerializableElement)
|
|
42
|
-
get id(): string;
|
|
43
|
-
get type(): string;
|
|
44
|
-
get executionId(): string;
|
|
45
|
-
get isThrowing(): boolean;
|
|
46
|
-
get activity(): Activity;
|
|
47
|
-
get broker(): Broker;
|
|
48
|
-
get logger(): ILogger;
|
|
49
|
-
get reference(): {
|
|
50
|
-
id?: string,
|
|
51
|
-
name: string,
|
|
52
|
-
referenceType: string,
|
|
53
|
-
};
|
|
54
|
-
[x: string]: any;
|
|
55
|
-
execute(executeMessage: ElementBrokerMessage): void;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
abstract class ElementBase {
|
|
59
|
-
get id(): string;
|
|
60
|
-
get type(): string;
|
|
61
|
-
get name(): string;
|
|
62
|
-
get parent(): ElementParent;
|
|
63
|
-
get behaviour(): SerializableElement;
|
|
64
|
-
get broker(): Broker;
|
|
65
|
-
get environment(): Environment;
|
|
66
|
-
get context(): Context;
|
|
67
|
-
get logger(): ILogger;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
abstract class Element<T> extends ElementBase {
|
|
71
|
-
get broker(): ElementBroker<T>;
|
|
72
|
-
stop(): void;
|
|
73
|
-
resume(): void;
|
|
74
|
-
getApi(message?: ElementBrokerMessage): Api<T>;
|
|
75
|
-
on(eventName: string, callback: CallableFunction, options?: any): Consumer;
|
|
76
|
-
once(eventName: string, callback: CallableFunction, options?: any): Consumer;
|
|
77
|
-
waitFor(eventName: string, options?: any): Promise<Api<T>>;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
interface ElementParent {
|
|
81
|
-
get id(): string;
|
|
82
|
-
get type(): string;
|
|
83
|
-
get executionId(): string;
|
|
84
|
-
get path(): ElementParent[];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
type Extension = (activity: ElementBase, context: Context) => IExtension;
|
|
88
|
-
interface IExtension {
|
|
89
|
-
activate(message: ElementBrokerMessage): void;
|
|
90
|
-
deactivate(message: ElementBrokerMessage): void;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
interface IExpressions {
|
|
94
|
-
resolveExpression(templatedString: string, context?: any, expressionFnContext?: any): any;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
interface EnvironmentSettings {
|
|
98
|
-
/** true returns dummy service function for service task if not found */
|
|
99
|
-
enableDummyService?: boolean;
|
|
100
|
-
/** true makes activity runs to go forward in steps, defaults to false */
|
|
101
|
-
step?: boolean;
|
|
102
|
-
/** strict mode, see documentation, defaults to false */
|
|
103
|
-
strict?: boolean;
|
|
104
|
-
/** positive integer to control parallel loop batch size, defaults to 50 */
|
|
105
|
-
batchSize?: number;
|
|
106
|
-
[x: string]: any;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
interface EnvironmentOptions {
|
|
110
|
-
settings?: EnvironmentSettings;
|
|
111
|
-
variables?: Record<string, any>;
|
|
112
|
-
services?: Record<string, CallableFunction>;
|
|
113
|
-
Logger?: LoggerFactory;
|
|
114
|
-
timers?: ITimers;
|
|
115
|
-
scripts?: IScripts;
|
|
116
|
-
extensions?: Record<string, Extension>;
|
|
117
|
-
/**
|
|
118
|
-
* optional override expressions handler
|
|
119
|
-
*/
|
|
120
|
-
expressions?: IExpressions;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
type startActivityFilterOptions = {
|
|
124
|
-
/** Event definition id, i.e. Message, Signal, Error, etc */
|
|
125
|
-
referenceId?: string,
|
|
126
|
-
/** Event definition type, i.e. message, signal, error, etc */
|
|
127
|
-
referenceType?: string
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
type filterPostponed = (elementApi: Api<ElementBase>) => boolean;
|
|
131
|
-
|
|
132
|
-
const enum DefinitionRunStatus {
|
|
133
|
-
Entered = 'entered',
|
|
134
|
-
Start = 'start',
|
|
135
|
-
Executing = 'executing',
|
|
136
|
-
End = 'end',
|
|
137
|
-
Discarded = 'discarded',
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const enum ProcessRunStatus {
|
|
141
|
-
Entered = 'entered',
|
|
142
|
-
Start = 'start',
|
|
143
|
-
Executing = 'executing',
|
|
144
|
-
Errored = 'errored',
|
|
145
|
-
End = 'end',
|
|
146
|
-
Discarded = 'discarded',
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Activity status
|
|
151
|
-
* Can be used to decide when to save states, Timer and Wait is recommended.
|
|
152
|
-
*/
|
|
153
|
-
const enum ActivityStatus {
|
|
154
|
-
/** Idle, not running anything */
|
|
155
|
-
Idle = 'idle',
|
|
156
|
-
/**
|
|
157
|
-
* At least one activity is executing,
|
|
158
|
-
* e.g. a service task making a asynchronous request
|
|
159
|
-
*/
|
|
160
|
-
Executing = 'executing',
|
|
161
|
-
/**
|
|
162
|
-
* At least one activity is waiting for a timer to complete,
|
|
163
|
-
* usually only TimerEventDefinition's
|
|
164
|
-
*/
|
|
165
|
-
Timer = 'timer',
|
|
166
|
-
/**
|
|
167
|
-
* At least one activity is waiting for a signal of some sort,
|
|
168
|
-
* e.g. user tasks, intermediate catch events, etc
|
|
169
|
-
*/
|
|
170
|
-
Wait = 'wait',
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Activity run status
|
|
175
|
-
*/
|
|
176
|
-
const enum ActivityRunStatus {
|
|
177
|
-
/** Run entered, triggered by taken inbound flow */
|
|
178
|
-
Entered = 'entered',
|
|
179
|
-
/** Run started */
|
|
180
|
-
Started = 'started',
|
|
181
|
-
/** Executing activity behaviour */
|
|
182
|
-
Executing = 'executing',
|
|
183
|
-
/** Activity behaviour execution completed successfully */
|
|
184
|
-
Executed = 'executed',
|
|
185
|
-
/** Run end, take outbound flows */
|
|
186
|
-
End = 'end',
|
|
187
|
-
/** Entering discard run, triggered by discarded inbound flow */
|
|
188
|
-
Discard = 'discard',
|
|
189
|
-
/** Run was discarded, discard outbound flows */
|
|
190
|
-
Discarded = 'discarded',
|
|
191
|
-
/** Activity behaviour execution failed, discard run */
|
|
192
|
-
Error = 'error',
|
|
193
|
-
/** Formatting next run message */
|
|
194
|
-
Formatting = 'formatting',
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
interface DefinitionExecution {
|
|
198
|
-
get id(): string;
|
|
199
|
-
get type(): string;
|
|
200
|
-
get broker(): Broker;
|
|
201
|
-
get environment(): Environment;
|
|
202
|
-
get context(): Context;
|
|
203
|
-
get executionId(): string;
|
|
204
|
-
get stopped(): boolean;
|
|
205
|
-
get completed(): boolean;
|
|
206
|
-
get status(): string;
|
|
207
|
-
get processes(): Process[];
|
|
208
|
-
get postponedCount(): number;
|
|
209
|
-
get isRunning(): boolean;
|
|
210
|
-
get activityStatus(): ActivityStatus;
|
|
211
|
-
execute(executeMessage: ElementBrokerMessage): void;
|
|
212
|
-
getProcesses(): Process[];
|
|
213
|
-
getProcessById(processId: string): Process;
|
|
214
|
-
getProcessesById(processId: string): Process[];
|
|
215
|
-
getProcessByExecutionId(processExecutionId: string): Process;
|
|
216
|
-
getRunningProcesses(): Process[];
|
|
217
|
-
getExecutableProcesses(): Process[];
|
|
218
|
-
getPostponed(filterFn: filterPostponed): Api<ElementBase>[];
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
interface ActivityExecution {
|
|
222
|
-
get completed(): boolean;
|
|
223
|
-
get executionId(): string;
|
|
224
|
-
get source(): ActivityBehaviour;
|
|
225
|
-
execute(executeMessage: ElementBrokerMessage): void;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
function ActivityBehaviour(activityDef: SerializableElement, context: Context): Activity;
|
|
229
|
-
interface ActivityBehaviour {
|
|
230
|
-
id: string;
|
|
231
|
-
type: string;
|
|
232
|
-
activity: Activity;
|
|
233
|
-
environment: Environment;
|
|
234
|
-
execute(executeMessage: ElementBrokerMessage): void;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
interface Api<T> extends ElementBrokerMessage {
|
|
238
|
-
get id(): string;
|
|
239
|
-
get type(): string;
|
|
240
|
-
get name(): string;
|
|
241
|
-
get executionId(): string;
|
|
242
|
-
get environment(): Environment;
|
|
243
|
-
get broker(): ElementBroker<T>;
|
|
244
|
-
get owner(): T;
|
|
245
|
-
cancel(message?: signalMessage, options?: any): void;
|
|
246
|
-
discard(): void;
|
|
247
|
-
fail(error: Error): void;
|
|
248
|
-
signal(message?: signalMessage, options?: any): void;
|
|
249
|
-
stop(): void;
|
|
250
|
-
resolveExpression(expression: string): any;
|
|
251
|
-
sendApiMessage(action: string, content?: signalMessage, options?: any): void;
|
|
252
|
-
getPostponed(...args: any[]): any[];
|
|
253
|
-
createMessage(content?: Record<string, any>): any;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
interface ExecutionScope {
|
|
257
|
-
/** Calling element id */
|
|
258
|
-
id: string;
|
|
259
|
-
/** Calling element type */
|
|
260
|
-
type: string;
|
|
261
|
-
/** Execution message fields */
|
|
262
|
-
fields: MessageFields;
|
|
263
|
-
/** Execution message content */
|
|
264
|
-
content: ElementMessageContent;
|
|
265
|
-
/** Execution message properties */
|
|
266
|
-
properties: MessageProperties;
|
|
267
|
-
environment: Environment;
|
|
268
|
-
/** Calling element logger instance */
|
|
269
|
-
logger?: ILogger;
|
|
270
|
-
/**
|
|
271
|
-
* Resolve expression with the current scope
|
|
272
|
-
* @param expression expression string
|
|
273
|
-
* @returns Whatever the expression returns
|
|
274
|
-
*/
|
|
275
|
-
resolveExpression: (expression: string) => any;
|
|
276
|
-
ActivityError: ActivityError;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
interface Script {
|
|
280
|
-
execute(executionContext: ExecutionScope, callback: CallableFunction): void;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
abstract class MessageElement {
|
|
284
|
-
get id(): string;
|
|
285
|
-
get type(): string;
|
|
286
|
-
get name(): string;
|
|
287
|
-
get parent(): ElementParent;
|
|
288
|
-
resolve(executionMessage: ElementBrokerMessage): {
|
|
289
|
-
parent: ElementParent;
|
|
290
|
-
name: string;
|
|
291
|
-
id: string;
|
|
292
|
-
type: string;
|
|
293
|
-
messageType: string;
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
class Environment {
|
|
298
|
-
constructor(options?: EnvironmentOptions);
|
|
299
|
-
options: Record<string, any>;
|
|
300
|
-
expressions: IExpressions;
|
|
301
|
-
extensions: Record<string, IExtension>;
|
|
302
|
-
scripts: IScripts;
|
|
303
|
-
timers: ITimers;
|
|
304
|
-
Logger: LoggerFactory;
|
|
305
|
-
get settings(): EnvironmentSettings;
|
|
306
|
-
get variables(): Record<string, any>;
|
|
307
|
-
get output(): Record<string, any>;
|
|
308
|
-
set services(arg: any);
|
|
309
|
-
get services(): any;
|
|
310
|
-
getState(): EnvironmentState;
|
|
311
|
-
recover(state?: EnvironmentState): Environment;
|
|
312
|
-
clone(overrideOptions?: EnvironmentOptions): Environment;
|
|
313
|
-
assignVariables(newVars: Record<string, any>): void;
|
|
314
|
-
assignSettings(newSettings: Record<string, any>): void;
|
|
315
|
-
registerScript(activity: any): Script;
|
|
316
|
-
getScript(language: string, identifier: {id: string, [x: string]: any}): Script;
|
|
317
|
-
getServiceByName(serviceName: string): CallableFunction;
|
|
318
|
-
resolveExpression(expression: string, message?: ElementBrokerMessage, expressionFnContext?: any): any;
|
|
319
|
-
addService(name: string, fn: CallableFunction): void;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
function Context(definitionContext: SerializableContext, environment?: Environment): Context;
|
|
323
|
-
class Context {
|
|
324
|
-
constructor(definitionContext: SerializableContext, environment?: Environment);
|
|
325
|
-
get id(): string;
|
|
326
|
-
get name(): string;
|
|
327
|
-
get type(): string;
|
|
328
|
-
/** Unique context instance id */
|
|
329
|
-
get sid(): string;
|
|
330
|
-
get definitionContext(): SerializableContext;
|
|
331
|
-
get environment(): Environment;
|
|
332
|
-
/** Context owner, Process or SubProcess activity */
|
|
333
|
-
get owner(): Process | Activity | undefined;
|
|
334
|
-
getActivityById<T>(activityId: string): T;
|
|
335
|
-
getSequenceFlowById(sequenceFlowId: string): SequenceFlow;
|
|
336
|
-
getInboundSequenceFlows(activityId: string): SequenceFlow[];
|
|
337
|
-
getOutboundSequenceFlows(activityId: string): SequenceFlow[];
|
|
338
|
-
getInboundAssociations(activityId: string): Association[];
|
|
339
|
-
getOutboundAssociations(activityId: string): Association[];
|
|
340
|
-
getActivities(scopeId?: string): ElementBase[];
|
|
341
|
-
getSequenceFlows(scopeId?: string): SequenceFlow[];
|
|
342
|
-
getAssociations(scopeId?: string): Association[];
|
|
343
|
-
clone(newEnvironment?: Environment): Context;
|
|
344
|
-
getProcessById(processId: string): Process;
|
|
345
|
-
getNewProcessById(processId: string): Process;
|
|
346
|
-
getProcesses(): Process[];
|
|
347
|
-
getExecutableProcesses(): Process[];
|
|
348
|
-
getMessageFlows(sourceId: string): MessageFlow[];
|
|
349
|
-
getDataObjectById(referenceId: string): any;
|
|
350
|
-
getDataStoreById(referenceId: string): any;
|
|
351
|
-
getStartActivities(filterOptions?: startActivityFilterOptions, scopeId?: string): Activity[];
|
|
352
|
-
loadExtensions(activity: ElementBase): IExtension;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
interface ElementState {
|
|
356
|
-
id: string;
|
|
357
|
-
type: string;
|
|
358
|
-
broker?: BrokerState;
|
|
359
|
-
[x: string]: any;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
interface EnvironmentState {
|
|
363
|
-
settings: EnvironmentSettings;
|
|
364
|
-
variables: Record<string, any>;
|
|
365
|
-
output: Record<string, any>;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
type completedCounters = { completed: number, discarded: number };
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
import { IActivityBehaviour, ActivityBehaviour, EventDefinition, MessageElement, ISODurationApi } from './types.js';
|
|
369
3
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
stopped: boolean,
|
|
409
|
-
executionId?: string;
|
|
410
|
-
counters: completedCounters;
|
|
411
|
-
environment: EnvironmentState;
|
|
412
|
-
execution?: ProcessExecutionState;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
interface DefinitionExecutionState {
|
|
416
|
-
executionId: string;
|
|
417
|
-
stopped: boolean;
|
|
418
|
-
completed: boolean;
|
|
419
|
-
status: string;
|
|
420
|
-
processes: ProcessState[];
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
interface DefinitionState extends ElementState {
|
|
424
|
-
status: string;
|
|
425
|
-
stopped: boolean,
|
|
426
|
-
executionId?: string;
|
|
427
|
-
counters: completedCounters;
|
|
428
|
-
environment: EnvironmentState;
|
|
429
|
-
execution?: DefinitionExecutionState;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
type runCallback = (err: Error, definitionApi: Api<Definition>) => void;
|
|
433
|
-
class Definition extends Element<Definition> {
|
|
434
|
-
constructor(context: Context, options?: EnvironmentOptions);
|
|
435
|
-
get counters(): completedCounters;
|
|
436
|
-
get execution(): DefinitionExecution;
|
|
437
|
-
get executionId(): string;
|
|
438
|
-
get isRunning(): boolean;
|
|
439
|
-
get status(): DefinitionRunStatus | undefined;
|
|
440
|
-
get stopped(): boolean;
|
|
441
|
-
get activityStatus(): ActivityStatus;
|
|
442
|
-
run(): Definition;
|
|
443
|
-
run(runContent: Record<string, any>): Definition;
|
|
444
|
-
run(runContent: Record<string, any>, callback: runCallback): Definition;
|
|
445
|
-
run(callback: runCallback): Definition;
|
|
446
|
-
getState(): DefinitionState;
|
|
447
|
-
recover(state?: DefinitionState): Definition;
|
|
448
|
-
resume(): void;
|
|
449
|
-
resume(callback: (err: Error, definitionApi: Api<Definition>) => void): void;
|
|
450
|
-
shake(startId?: string): object;
|
|
451
|
-
getProcesses(): Process[];
|
|
452
|
-
/** get processes marked with isExecutable=true */
|
|
453
|
-
getExecutableProcesses(): Process[];
|
|
454
|
-
getRunningProcesses(): Process[];
|
|
455
|
-
getProcessById(processId: string): Process;
|
|
456
|
-
getActivityById(childId: string): Activity;
|
|
457
|
-
getElementById<T>(elementId: string): Element<T>;
|
|
458
|
-
getPostponed(filterFn?: filterPostponed): Api<ElementBase>[];
|
|
459
|
-
/** Send delegated signal message */
|
|
460
|
-
signal(message: any): void;
|
|
461
|
-
cancelActivity(message: any): void;
|
|
462
|
-
sendMessage(message: any): void;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
class Process extends Element<Process> {
|
|
466
|
-
constructor(processDef: SerializableElement, context: Context);
|
|
467
|
-
get isExecutable(): boolean;
|
|
468
|
-
get counters(): completedCounters;
|
|
469
|
-
get lanes(): Lane[] | undefined;
|
|
470
|
-
get extensions(): IExtension;
|
|
471
|
-
get stopped(): boolean;
|
|
472
|
-
get isRunning(): boolean;
|
|
473
|
-
get executionId(): string;
|
|
474
|
-
get execution(): ProcessExecution;
|
|
475
|
-
get status(): ProcessRunStatus | undefined;
|
|
476
|
-
get activityStatus(): ActivityStatus;
|
|
477
|
-
init(useAsExecutionId?: string): void;
|
|
478
|
-
run(runContent?: Record<string, any>): void;
|
|
479
|
-
getState(): ProcessState;
|
|
480
|
-
recover(state?: ProcessState): Process;
|
|
481
|
-
shake(startId?: string): void;
|
|
482
|
-
signal(message: any): any;
|
|
483
|
-
cancelActivity(message: any): any;
|
|
484
|
-
sendMessage(message: any): void;
|
|
485
|
-
getActivityById<T>(childId: string): T;
|
|
486
|
-
getActivities(): Activity[];
|
|
487
|
-
getStartActivities(filterOptions?: startActivityFilterOptions): Activity[];
|
|
488
|
-
getSequenceFlows(): SequenceFlow[];
|
|
489
|
-
getLaneById(laneId: string): Lane | undefined;
|
|
490
|
-
getPostponed(filterFn: filterPostponed): Api<ElementBase>[];
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
interface ProcessExecution {
|
|
494
|
-
get isSubProcess(): boolean;
|
|
495
|
-
get broker(): Broker;
|
|
496
|
-
get environment(): Environment;
|
|
497
|
-
get context(): Context;
|
|
498
|
-
get executionId(): string;
|
|
499
|
-
get stopped(): boolean;
|
|
500
|
-
get completed(): boolean;
|
|
501
|
-
get status(): string;
|
|
502
|
-
get postponedCount(): number;
|
|
503
|
-
get isRunning(): boolean;
|
|
504
|
-
get activityStatus(): ActivityStatus;
|
|
505
|
-
execute(executeMessage: ElementBrokerMessage): void;
|
|
506
|
-
getPostponed(filterFn: filterPostponed): Api<ElementBase>[];
|
|
507
|
-
getActivities(): Activity[];
|
|
508
|
-
getActivityById<T>(activityId: string): T;
|
|
509
|
-
getSequenceFlows(): SequenceFlow[];
|
|
510
|
-
getApi(message?: ElementBrokerMessage): Api<ElementBase>;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
class Lane extends ElementBase {
|
|
514
|
-
constructor(process: Process, laneDefinition: SerializableElement);
|
|
515
|
-
/** Process broker */
|
|
516
|
-
get broker(): Broker;
|
|
517
|
-
get process(): Process;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
interface ISequenceFlowCondition {
|
|
521
|
-
/** Condition type, e.g. script or expression */
|
|
522
|
-
get type(): string;
|
|
523
|
-
/**
|
|
524
|
-
* Execute sequence flow condition
|
|
525
|
-
* @param message Source element execution message
|
|
526
|
-
* @param callback Callback with truthy result if flow should be taken
|
|
527
|
-
*/
|
|
528
|
-
execute(message: ElementBrokerMessage, callback: (err: Error, result: any) => void): void;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
class SequenceFlow extends Element<SequenceFlow> {
|
|
532
|
-
get sourceId(): string;
|
|
533
|
-
get targetId(): string;
|
|
534
|
-
get isDefault(): boolean;
|
|
535
|
-
get isSequenceFlow(): boolean;
|
|
536
|
-
get counters(): {take: number, discard: number, looped: number};
|
|
537
|
-
take(content?: any): boolean;
|
|
538
|
-
discard(content?: any): void;
|
|
539
|
-
shake(message: any): number;
|
|
540
|
-
getCondition(): ISequenceFlowCondition | null;
|
|
541
|
-
createMessage(override?: any): object;
|
|
542
|
-
/**
|
|
543
|
-
* Evaluate flow
|
|
544
|
-
* Executes condition if any, default flow is
|
|
545
|
-
* @param fromMessage Activity message
|
|
546
|
-
* @param {evaluateCallback} callback Callback with evaluation result, if truthy flow should be taken
|
|
547
|
-
*/
|
|
548
|
-
evaluate(fromMessage: ElementBrokerMessage, callback: (err: Error, result: any) => void): void;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
interface MessageFlowReference {
|
|
552
|
-
/** activity id */
|
|
553
|
-
get id(): string;
|
|
554
|
-
get processId(): string;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
class MessageFlow extends Element<MessageFlow> {
|
|
558
|
-
get source(): MessageFlowReference;
|
|
559
|
-
get target(): MessageFlowReference;
|
|
560
|
-
get counters(): { messages: number };
|
|
561
|
-
activate(): void;
|
|
562
|
-
deactivate(): void;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
class Association extends Element<Association> {
|
|
566
|
-
get sourceId(): string;
|
|
567
|
-
get targetId(): string;
|
|
568
|
-
get isAssociation(): boolean;
|
|
569
|
-
get counters(): {take: number, discard: number };
|
|
570
|
-
take(content?: any): boolean;
|
|
571
|
-
discard(content?: any): boolean;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
type LoggerFactory = (scope: string) => ILogger;
|
|
575
|
-
|
|
576
|
-
interface ILogger {
|
|
577
|
-
debug(...args: any[]): void;
|
|
578
|
-
error(...args: any[]): void;
|
|
579
|
-
warn(...args: any[]): void;
|
|
580
|
-
[x: string]: any,
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
type wrappedSetTimeout = (handler: TimerHandler, delay: number, ...args: any[]) => Timer;
|
|
584
|
-
type wrappedClearTimeout = (ref: any) => void;
|
|
585
|
-
|
|
586
|
-
interface Timer {
|
|
587
|
-
/** The function to call when the timer elapses */
|
|
588
|
-
readonly callback: TimerHandler;
|
|
589
|
-
/** The number of milliseconds to wait before calling the callback */
|
|
590
|
-
readonly delay: number;
|
|
591
|
-
/** Optional arguments to pass when the callback is called */
|
|
592
|
-
readonly args?: any[];
|
|
593
|
-
/** Timer owner if any */
|
|
594
|
-
readonly owner?: any;
|
|
595
|
-
/** Timer Id */
|
|
596
|
-
readonly timerId: string;
|
|
597
|
-
/** Timeout, return from setTimeout */
|
|
598
|
-
readonly timerRef: any;
|
|
599
|
-
[x: string]: any;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
interface RegisteredTimer {
|
|
603
|
-
owner?: any;
|
|
604
|
-
get setTimeout(): wrappedSetTimeout;
|
|
605
|
-
get clearTimeout(): wrappedClearTimeout;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
interface ITimers {
|
|
609
|
-
get setTimeout(): wrappedSetTimeout;
|
|
610
|
-
get clearTimeout(): wrappedClearTimeout;
|
|
611
|
-
register(owner?: any): RegisteredTimer;
|
|
612
|
-
[x: string]: any;
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
interface TimersOptions {
|
|
616
|
-
/** Defaults to builtin setTimeout */
|
|
617
|
-
setTimeout?: typeof setTimeout;
|
|
618
|
-
/** Defaults to builtin clearTimeout */
|
|
619
|
-
clearTimeout?: typeof clearTimeout;
|
|
620
|
-
[x: string]: any;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
class Timers implements ITimers {
|
|
624
|
-
options: TimersOptions;
|
|
625
|
-
constructor(options?: TimersOptions);
|
|
626
|
-
get executing(): Timer[];
|
|
627
|
-
get setTimeout(): wrappedSetTimeout;
|
|
628
|
-
get clearTimeout(): wrappedClearTimeout;
|
|
629
|
-
register(owner?: any): RegisteredTimer;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
interface IScripts {
|
|
633
|
-
register(activity: any): Script | undefined;
|
|
634
|
-
getScript(language: string, identifier: {id: string, [x: string]: any}): Script;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
interface Activity extends Element<Activity> {
|
|
638
|
-
get Behaviour(): ActivityBehaviour;
|
|
639
|
-
get stopped(): boolean;
|
|
640
|
-
get status(): ActivityRunStatus | undefined;
|
|
641
|
-
get counters(): { taken: number, discarded: number };
|
|
642
|
-
get execution(): ActivityExecution;
|
|
643
|
-
get executionId(): string;
|
|
644
|
-
get extensions(): IExtension;
|
|
645
|
-
get isRunning(): boolean;
|
|
646
|
-
get outbound(): SequenceFlow[];
|
|
647
|
-
get inbound(): SequenceFlow[];
|
|
648
|
-
get isEnd(): boolean;
|
|
649
|
-
get isStart(): boolean;
|
|
650
|
-
get isSubProcess(): boolean;
|
|
651
|
-
get isMultiInstance(): boolean;
|
|
652
|
-
get isThrowing(): boolean;
|
|
653
|
-
get isForCompensation(): boolean;
|
|
654
|
-
get triggeredByEvent(): boolean;
|
|
655
|
-
get attachedTo(): Activity;
|
|
656
|
-
get eventDefinitions(): EventDefinition[];
|
|
657
|
-
/** Parent element process or sub process reference */
|
|
658
|
-
get parentElement(): Process | Activity;
|
|
659
|
-
activate(): void;
|
|
660
|
-
deactivate(): void;
|
|
661
|
-
init(initContent?: any): void;
|
|
662
|
-
run(runContent?: any): void;
|
|
663
|
-
discard(discardContent?: any): void;
|
|
664
|
-
next(): ElementBrokerMessage;
|
|
665
|
-
shake(): void;
|
|
666
|
-
evaluateOutbound(fromMessage: ElementBrokerMessage, discardRestAtTake: boolean, callback: (err: Error, evaluationResult: any) => void): void;
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
var BoundaryEvent: typeof ActivityBehaviour;
|
|
670
|
-
var CallActivity: typeof ActivityBehaviour;
|
|
671
|
-
var Dummy: typeof ActivityBehaviour;
|
|
672
|
-
var TextAnnotation: typeof Dummy;
|
|
673
|
-
var Group: typeof Dummy;
|
|
674
|
-
var Category: typeof Dummy;
|
|
675
|
-
var EndEvent: typeof ActivityBehaviour;
|
|
676
|
-
var EventBasedGateway: typeof ActivityBehaviour;
|
|
677
|
-
var ExclusiveGateway: typeof ActivityBehaviour;
|
|
678
|
-
var InclusiveGateway: typeof ActivityBehaviour;
|
|
679
|
-
var IntermediateCatchEvent: typeof ActivityBehaviour;
|
|
680
|
-
var IntermediateThrowEvent: typeof ActivityBehaviour;
|
|
681
|
-
var ParallelGateway: typeof ActivityBehaviour;
|
|
682
|
-
var ReceiveTask: typeof ActivityBehaviour;
|
|
683
|
-
var ScriptTask: typeof ActivityBehaviour;
|
|
684
|
-
var ServiceTask: typeof ActivityBehaviour;
|
|
685
|
-
var SendTask: typeof ServiceTask;
|
|
686
|
-
var BusinessRuleTask: typeof ServiceTask;
|
|
687
|
-
var SignalTask: typeof ActivityBehaviour;
|
|
688
|
-
var ManualTask: typeof SignalTask;
|
|
689
|
-
var UserTask: typeof SignalTask;
|
|
690
|
-
var StartEvent: typeof ActivityBehaviour;
|
|
691
|
-
var SubProcess: typeof ActivityBehaviour;
|
|
692
|
-
var Task: typeof ActivityBehaviour;
|
|
693
|
-
var Transaction: typeof ActivityBehaviour;
|
|
694
|
-
|
|
695
|
-
var CancelEventDefinition: EventDefinition;
|
|
696
|
-
var CompensateEventDefinition: EventDefinition;
|
|
697
|
-
var ConditionalEventDefinition: EventDefinition;
|
|
698
|
-
var ErrorEventDefinition: EventDefinition;
|
|
699
|
-
var EscalationEventDefinition: EventDefinition;
|
|
700
|
-
var LinkEventDefinition: EventDefinition;
|
|
701
|
-
var MessageEventDefinition: EventDefinition;
|
|
702
|
-
var SignalEventDefinition: EventDefinition;
|
|
703
|
-
var TerminateEventDefinition: EventDefinition;
|
|
704
|
-
|
|
705
|
-
const enum TimerType {
|
|
4
|
+
declare module 'bpmn-elements' {
|
|
5
|
+
export var BoundaryEvent: typeof ActivityBehaviour;
|
|
6
|
+
export var CallActivity: typeof ActivityBehaviour;
|
|
7
|
+
export var Dummy: typeof ActivityBehaviour;
|
|
8
|
+
export var TextAnnotation: typeof Dummy;
|
|
9
|
+
export var Group: typeof Dummy;
|
|
10
|
+
export var Category: typeof Dummy;
|
|
11
|
+
export var EndEvent: typeof ActivityBehaviour;
|
|
12
|
+
export var EventBasedGateway: typeof ActivityBehaviour;
|
|
13
|
+
export var ExclusiveGateway: typeof ActivityBehaviour;
|
|
14
|
+
export var InclusiveGateway: typeof ActivityBehaviour;
|
|
15
|
+
export var IntermediateCatchEvent: typeof ActivityBehaviour;
|
|
16
|
+
export var IntermediateThrowEvent: typeof ActivityBehaviour;
|
|
17
|
+
export var ParallelGateway: typeof ActivityBehaviour;
|
|
18
|
+
export var ReceiveTask: typeof ActivityBehaviour;
|
|
19
|
+
export var ScriptTask: typeof ActivityBehaviour;
|
|
20
|
+
export var ServiceTask: typeof ActivityBehaviour;
|
|
21
|
+
export var SendTask: typeof ServiceTask;
|
|
22
|
+
export var BusinessRuleTask: typeof ServiceTask;
|
|
23
|
+
export var SignalTask: typeof ActivityBehaviour;
|
|
24
|
+
export var ManualTask: typeof SignalTask;
|
|
25
|
+
export var UserTask: typeof SignalTask;
|
|
26
|
+
export var StartEvent: typeof ActivityBehaviour;
|
|
27
|
+
export var SubProcess: typeof ActivityBehaviour;
|
|
28
|
+
export var Task: typeof ActivityBehaviour;
|
|
29
|
+
export var Transaction: typeof ActivityBehaviour;
|
|
30
|
+
|
|
31
|
+
export var CancelEventDefinition: EventDefinition;
|
|
32
|
+
export var CompensateEventDefinition: EventDefinition;
|
|
33
|
+
export var ConditionalEventDefinition: EventDefinition;
|
|
34
|
+
export var ErrorEventDefinition: EventDefinition;
|
|
35
|
+
export var EscalationEventDefinition: EventDefinition;
|
|
36
|
+
export var LinkEventDefinition: EventDefinition;
|
|
37
|
+
export var MessageEventDefinition: EventDefinition;
|
|
38
|
+
export var SignalEventDefinition: EventDefinition;
|
|
39
|
+
export var TerminateEventDefinition: EventDefinition;
|
|
40
|
+
|
|
41
|
+
export const enum TimerType {
|
|
706
42
|
TimeCycle = 'timeCycle',
|
|
707
43
|
TimeDuration = 'timeDuration',
|
|
708
44
|
TimeDate = 'timeDate',
|
|
@@ -717,7 +53,7 @@ declare module 'bpmn-elements' {
|
|
|
717
53
|
delay?: number,
|
|
718
54
|
};
|
|
719
55
|
|
|
720
|
-
class TimerEventDefinition extends EventDefinition {
|
|
56
|
+
export class TimerEventDefinition extends EventDefinition {
|
|
721
57
|
/**
|
|
722
58
|
* Parse timer type
|
|
723
59
|
* @param timerType type of timer
|
|
@@ -726,70 +62,36 @@ declare module 'bpmn-elements' {
|
|
|
726
62
|
parse(timerType: TimerType, timerValue: string): parsedTimer;
|
|
727
63
|
}
|
|
728
64
|
|
|
729
|
-
class
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
get name(): string;
|
|
733
|
-
get errorCode(): string;
|
|
734
|
-
resolve(executionMessage: ElementBrokerMessage, error: any): {
|
|
735
|
-
id: string;
|
|
736
|
-
type: string;
|
|
737
|
-
messageType: string;
|
|
738
|
-
name: string;
|
|
739
|
-
code: string;
|
|
740
|
-
inner?: any
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
class ServiceImplementation {
|
|
745
|
-
constructor(activity: Activity);
|
|
746
|
-
get type(): string;
|
|
747
|
-
get implementation(): string;
|
|
748
|
-
get activity(): Activity;
|
|
749
|
-
execute(executionMessage: ElementBrokerMessage, callback: CallableFunction): void;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
class Message extends MessageElement {}
|
|
753
|
-
class Signal extends MessageElement {}
|
|
754
|
-
class Escalation extends MessageElement {}
|
|
65
|
+
export class Message extends MessageElement {}
|
|
66
|
+
export class Signal extends MessageElement {}
|
|
67
|
+
export class Escalation extends MessageElement {}
|
|
755
68
|
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
description: string;
|
|
759
|
-
/** Activity that threw error */
|
|
760
|
-
source?: ElementBrokerMessage;
|
|
761
|
-
/** Original error */
|
|
762
|
-
inner?: Error;
|
|
763
|
-
code?: string;
|
|
764
|
-
constructor(description: string, sourceMessage: MessageMessage, inner?: Error);
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
interface Duration {
|
|
768
|
-
years?: number;
|
|
769
|
-
months?: number;
|
|
770
|
-
weeks?: number;
|
|
771
|
-
days?: number;
|
|
772
|
-
hours?: number;
|
|
773
|
-
minutes?: number;
|
|
774
|
-
seconds?: number;
|
|
775
|
-
repeat?: number;
|
|
776
|
-
}
|
|
69
|
+
export var ISODuration: ISODurationApi;
|
|
70
|
+
}
|
|
777
71
|
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
}
|
|
72
|
+
declare module "bpmn-elements/events" {
|
|
73
|
+
export var BoundaryEventBehaviour: IActivityBehaviour;
|
|
74
|
+
export var EndEventBehaviour: IActivityBehaviour;
|
|
75
|
+
export var IntermediateCatchEventBehaviour: IActivityBehaviour;
|
|
76
|
+
export var IntermediateThrowEventBehaviour: IActivityBehaviour;
|
|
77
|
+
export var StartEventBehaviour: IActivityBehaviour;
|
|
78
|
+
}
|
|
786
79
|
|
|
787
|
-
|
|
80
|
+
declare module "bpmn-elements/gateways" {
|
|
81
|
+
export var EventBasedGatewayBehaviour: IActivityBehaviour;
|
|
82
|
+
export var ExclusiveGatewayBehaviour: IActivityBehaviour;
|
|
83
|
+
export var InclusiveGatewayBehaviour: IActivityBehaviour;
|
|
84
|
+
export var ParallelGatewayBehaviour: IActivityBehaviour;
|
|
788
85
|
}
|
|
789
86
|
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
*/
|
|
87
|
+
declare module "bpmn-elements/tasks" {
|
|
88
|
+
export var CallActivityBehaviour: IActivityBehaviour;
|
|
89
|
+
export var ReceiveTaskBehaviour: IActivityBehaviour;
|
|
90
|
+
export var ScriptTaskBehaviour: IActivityBehaviour;
|
|
91
|
+
export var ServiceTaskBehaviour: IActivityBehaviour;
|
|
92
|
+
/** Signal-, Manual-, and User-task behaviour */
|
|
93
|
+
export var SignalTaskBehaviour: IActivityBehaviour;
|
|
94
|
+
/** Sub process and Transaction behaviour */
|
|
95
|
+
export var SubProcessBehaviour: IActivityBehaviour;
|
|
96
|
+
export var TaskBehaviour: IActivityBehaviour;
|
|
97
|
+
}
|