bpmn-elements 11.0.0 → 11.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types/index.d.ts +47 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmn-elements",
3
- "version": "11.0.0",
3
+ "version": "11.0.1",
4
4
  "description": "Executable workflow elements based on BPMN 2.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/types/index.d.ts CHANGED
@@ -129,6 +129,23 @@ declare module 'bpmn-elements' {
129
129
 
130
130
  type filterPostponed = (elementApi: Api<ElementBase>) => boolean;
131
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
+
132
149
  /**
133
150
  * Activity status
134
151
  * Can be used to decide when to save states, Timer and Wait is recommended.
@@ -153,6 +170,30 @@ declare module 'bpmn-elements' {
153
170
  Wait = 'wait',
154
171
  }
155
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
+
156
197
  interface DefinitionExecution {
157
198
  get id(): string;
158
199
  get type(): string;
@@ -162,7 +203,7 @@ declare module 'bpmn-elements' {
162
203
  get executionId(): string;
163
204
  get stopped(): boolean;
164
205
  get completed(): boolean;
165
- get status(): boolean;
206
+ get status(): string;
166
207
  get processes(): Process[];
167
208
  get postponedCount(): number;
168
209
  get isRunning(): boolean;
@@ -314,7 +355,6 @@ declare module 'bpmn-elements' {
314
355
  interface ElementState {
315
356
  id: string;
316
357
  type: string;
317
- name: string;
318
358
  broker?: BrokerState;
319
359
  [x: string]: any;
320
360
  }
@@ -333,9 +373,9 @@ declare module 'bpmn-elements' {
333
373
  }
334
374
 
335
375
  interface ActivityState extends ElementState {
376
+ status?: string,
336
377
  executionId: string;
337
378
  stopped: boolean;
338
- behaviour: Record<string, any>;
339
379
  counters: { taken: number, discarded: number };
340
380
  execution?: ActivityExecutionState;
341
381
  }
@@ -344,17 +384,12 @@ declare module 'bpmn-elements' {
344
384
  counters: {take: number, discard: number, looped: number};
345
385
  }
346
386
 
347
- interface MessageFlowState {
348
- id: string;
349
- type: string;
387
+ interface MessageFlowState extends ElementState {
350
388
  counters: {messages: number};
351
389
  }
352
390
 
353
391
  interface AssociationState extends ElementState {
354
392
  counters: {take: number, discard: number };
355
- sourceId: string;
356
- targetId: string;
357
- isAssociation: boolean;
358
393
  }
359
394
 
360
395
  interface ProcessExecutionState {
@@ -401,7 +436,7 @@ declare module 'bpmn-elements' {
401
436
  get execution(): DefinitionExecution;
402
437
  get executionId(): string;
403
438
  get isRunning(): boolean;
404
- get status(): string;
439
+ get status(): DefinitionRunStatus | undefined;
405
440
  get stopped(): boolean;
406
441
  get activityStatus(): ActivityStatus;
407
442
  run(): Definition;
@@ -437,7 +472,7 @@ declare module 'bpmn-elements' {
437
472
  get isRunning(): boolean;
438
473
  get executionId(): string;
439
474
  get execution(): ProcessExecution;
440
- get status(): string;
475
+ get status(): ProcessRunStatus | undefined;
441
476
  get activityStatus(): ActivityStatus;
442
477
  init(useAsExecutionId?: string): void;
443
478
  run(runContent?: Record<string, any>): void;
@@ -602,7 +637,7 @@ declare module 'bpmn-elements' {
602
637
  interface Activity extends Element<Activity> {
603
638
  get Behaviour(): ActivityBehaviour;
604
639
  get stopped(): boolean;
605
- get status(): string;
640
+ get status(): ActivityRunStatus | undefined;
606
641
  get counters(): { taken: number, discarded: number };
607
642
  get execution(): ActivityExecution;
608
643
  get executionId(): string;