bpmn-elements 13.1.2 → 13.2.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.
Files changed (73) hide show
  1. package/README.md +1 -2
  2. package/dist/Context.js +36 -2
  3. package/dist/definition/DefinitionExecution.js +1 -1
  4. package/dist/getPropertyValue.js +1 -2
  5. package/dist/index.js +1 -1
  6. package/package.json +14 -13
  7. package/src/Api.js +18 -20
  8. package/src/Context.js +49 -7
  9. package/src/Environment.js +10 -20
  10. package/src/EventBroker.js +21 -27
  11. package/src/MessageFormatter.js +23 -19
  12. package/src/Tracker.js +4 -4
  13. package/src/activity/Activity.js +141 -109
  14. package/src/activity/ActivityExecution.js +38 -29
  15. package/src/activity/Dummy.js +3 -3
  16. package/src/activity/Escalation.js +4 -4
  17. package/src/activity/ExecutionScope.js +4 -4
  18. package/src/activity/Message.js +5 -5
  19. package/src/activity/Signal.js +5 -5
  20. package/src/definition/Definition.js +44 -36
  21. package/src/definition/DefinitionExecution.js +97 -66
  22. package/src/error/BpmnError.js +3 -3
  23. package/src/error/Errors.js +19 -14
  24. package/src/eventDefinitions/CancelEventDefinition.js +16 -11
  25. package/src/eventDefinitions/CompensateEventDefinition.js +28 -23
  26. package/src/eventDefinitions/ConditionalEventDefinition.js +42 -23
  27. package/src/eventDefinitions/ErrorEventDefinition.js +47 -34
  28. package/src/eventDefinitions/EscalationEventDefinition.js +21 -20
  29. package/src/eventDefinitions/EventDefinitionExecution.js +6 -6
  30. package/src/eventDefinitions/LinkEventDefinition.js +28 -22
  31. package/src/eventDefinitions/MessageEventDefinition.js +47 -36
  32. package/src/eventDefinitions/SignalEventDefinition.js +42 -31
  33. package/src/eventDefinitions/TerminateEventDefinition.js +4 -4
  34. package/src/eventDefinitions/TimerEventDefinition.js +41 -29
  35. package/src/events/BoundaryEvent.js +81 -46
  36. package/src/events/EndEvent.js +2 -2
  37. package/src/events/IntermediateCatchEvent.js +8 -4
  38. package/src/events/IntermediateThrowEvent.js +2 -2
  39. package/src/events/StartEvent.js +29 -18
  40. package/src/flows/Association.js +11 -11
  41. package/src/flows/MessageFlow.js +16 -14
  42. package/src/flows/SequenceFlow.js +22 -20
  43. package/src/gateways/EventBasedGateway.js +7 -6
  44. package/src/gateways/ExclusiveGateway.js +4 -4
  45. package/src/gateways/InclusiveGateway.js +3 -3
  46. package/src/gateways/ParallelGateway.js +4 -4
  47. package/src/getPropertyValue.js +3 -6
  48. package/src/index.js +1 -1
  49. package/src/io/BpmnIO.js +5 -6
  50. package/src/io/EnvironmentDataObject.js +2 -3
  51. package/src/io/EnvironmentDataStore.js +2 -2
  52. package/src/io/EnvironmentDataStoreReference.js +2 -2
  53. package/src/io/InputOutputSpecification.js +60 -54
  54. package/src/io/Properties.js +45 -33
  55. package/src/iso-duration.js +9 -13
  56. package/src/messageHelper.js +16 -23
  57. package/src/process/Lane.js +3 -3
  58. package/src/process/Process.js +40 -34
  59. package/src/process/ProcessExecution.js +122 -78
  60. package/src/tasks/CallActivity.js +109 -57
  61. package/src/tasks/LoopCharacteristics.js +30 -18
  62. package/src/tasks/ReceiveTask.js +59 -38
  63. package/src/tasks/ScriptTask.js +17 -8
  64. package/src/tasks/ServiceTask.js +16 -9
  65. package/src/tasks/SignalTask.js +47 -28
  66. package/src/tasks/StandardLoopCharacteristics.js +3 -3
  67. package/src/tasks/SubProcess.js +9 -8
  68. package/src/tasks/Task.js +4 -3
  69. package/src/tasks/Transaction.js +1 -1
  70. package/types/index.d.ts +6 -6
  71. package/types/types.d.ts +39 -35
  72. package/CHANGELOG.md +0 -459
  73. package/src/ExtensionsMapper.js +0 -42
package/CHANGELOG.md DELETED
@@ -1,459 +0,0 @@
1
- Changelog
2
- =========
3
-
4
- # 13.1.2
5
-
6
- - fix another lingering leave message. Now it was the definition execution that kept `process.leave` messages around for sentimental reasons
7
-
8
- # 13.1.1
9
-
10
- - found the real reason behind ever groving state size - `activity.leave` messages were not acked by process execution. Doh!
11
-
12
- # 13.1.0
13
-
14
- - introduce `disableTrackState` setting. Tracking of elements is done by counters, e.g. activity taken or discarded, sequence flow taken and discarded. Counters are saved when getting state. If you run really big flows the state will keep all elements just to be able to recover the number of times an element has been touched. Needless to say it the state will grow out of it's comfort zone. Setting `disableTrackState` to true will only return state for elements that are actually running
15
-
16
- ## Breaking
17
-
18
- - `getState()` can return undefined
19
-
20
- # 13.0.0
21
-
22
- - export task-, events-, and gateway activity behaviors through `bpmn-elements/tasks`, `bpmn-elements/events`, and `bpmn-elements/gateways` respectively
23
- - refactor type definitions for three days to make the above type safe and VS-code happy. Why is it so freaking complicated? Ambient bla bla bla ts(4-digit-number)??? Looped through all 10.000 ts-typescript errors. Patches are inevitable and imminent
24
- - use `Object.defineProperties` when feasible and skip pointless enumerable option on property
25
-
26
- # 12.0.0
27
-
28
- Memory issues running sequential multi-instance sub-process (MISP). All MISP executions are put in a list to be able to save state.
29
-
30
- ## Breaking
31
-
32
- - remove MISP execution from execution reference list when iteration is completed, discarded, or errored
33
-
34
- # 11.1.1
35
-
36
- - fix boundary event not cancelling task if resumed before task was resumed
37
- - a cancelled call activity should also cancel the called process even if resumed before called process was resumed later
38
-
39
- # 11.1.0
40
-
41
- - bump [smqp@8](https://github.com/paed01/smqp/blob/default/CHANGELOG.md)
42
-
43
- # 11.0.1
44
-
45
- - update neglected type definition
46
-
47
- # 11.0.0
48
-
49
- - slim activity state by removing properties not needed for recover, might be breaking if state is inspected
50
- - slim process state by removing properties not needed for recover, might be breaking if state is inspected
51
-
52
- # 10.1.0
53
-
54
- - introduce Lane behaviour
55
- - add process `lanes` property with Lane instances
56
- - add activity `lane` property containing a reference to the process lane instance
57
- - add activity `parentElement` property referencing parent process or sub process
58
-
59
- # 10.0.0
60
-
61
- - drop iso8601-duration dependency and copy source (with licence). Export as `ISODuration`. Extend with repeat pattern parsing, e.g. `R3/PT1H` that corresponds to three repetitions every one hour
62
- - expose `TimerEventDefinition.parse(timerType, value)` function for extension purposes
63
- - prototype and export built-in `Timers`
64
-
65
- # 9.2.0
66
-
67
- - move outbound sequence flow evaluation logic from activity to sequence flow, where it belongs
68
- - spread sequence flow evaluation result, if object, to sequence flow take message
69
-
70
- # 9.1.3
71
-
72
- - type declare execution scope
73
-
74
- # 9.1.2
75
-
76
- - allow type IScripts.register to return undefined
77
-
78
- # 9.1.1
79
-
80
- - fix type Logger declaration
81
- - type declare element `getState` return states
82
-
83
- # 9.1.0
84
-
85
- - refactor compensation and transaction functionality
86
- - fix event based gateway bug when/if a subsequent event completes immediately
87
- - add somewhat expirimental activityStatus property to process and definition, tracked by Tracker that tracks executing, wait, and timer activity
88
-
89
- # 9.0.0
90
-
91
- - Turn into module with exports for node
92
- - Add basic type declaration, still learning
93
- - return Api instance for Message- and Association flows, as stated by type declaration
94
-
95
- # 8.2.4
96
-
97
- - allow process to start before receiving api messages, should fix issue #32
98
-
99
- # 8.2.3
100
-
101
- - fix resumed boundary event initialized twice even if it's completed
102
- - fix process lingering completed activities after resume
103
-
104
- # 8.2.2
105
-
106
- - mitigate possible stack overflow error by not acking message before publishing a new one. Fix after fix #31
107
-
108
- # 8.2.1
109
-
110
- - fix resume on caught activity error throws #31
111
-
112
- # 8.2.0
113
-
114
- - fix resume when activity has formatting status, extensions were not re-activated
115
- - fix InputOutputSpecification output now passed as dataOutput instead of dataInput, as it should
116
- - refactor Extensions loading, bpmn io is now pushed to the end of the extensions list
117
-
118
- # 8.1.0
119
-
120
- - support non-interrupting BoundaryEvent with ISO8601 repeating interval timeCycle
121
-
122
- # 8.0.1
123
-
124
- ## Fix
125
-
126
- - fix activity stuck in async formatting when resuming, preventing it to complete
127
-
128
- # 8.0.0
129
-
130
- ## Breaking
131
-
132
- - all processes will invoked with a cloned context and environment
133
- - a cloned environment will no longer forward output
134
- - remove output prop from process state. Not sure why it was there in the first place?
135
- - remove mysterious options symbol from Environment
136
-
137
- ## Fix
138
-
139
- - fix double completion if resumed on error
140
-
141
- # 7.0.0
142
-
143
- Support Call activity
144
-
145
- - prototype all behaviours
146
- - add api fail function
147
-
148
- ## Breaking
149
-
150
- - all Behaviours will be invoked with new
151
- - unable to make activity throw if emitFatal is called within activity, unsure why?
152
-
153
- ## Fix
154
-
155
- - Signals are now broadcasted to multiple targets, previously it stopped at first catch
156
-
157
- # 6.0.0
158
-
159
- Isomorphism and state.
160
-
161
- ## Breaking
162
- - Stop calling `setTimeout.call(owner, ...args)` in default Timers.js. Doesn't work in browsers and results in `TypeError: Illegal invocation`. Hence, timeout callback context is no longer the owner of the timer. Altough, it works fine in nodejs. So feel free to build your own [Timers](/docs/Timers.md) and pass it as an [option](/docs/Definition.md).
163
- - Removed sequence flow function `evaluateCondition` since it not used and was inconsistent. Use `getCondition().execute(...args)` instead.
164
- - Generate a slimmer state. Element broker state now only contains queues that have pending messages and sometimes an exchange with undelivered message. Not really breaking unless broker state was inspected for some reason
165
-
166
- ## Bugfix
167
- - Sequence flow with expression condition that throws will now terminate the run
168
- - Association counters were flipped
169
-
170
- # 5.2.0
171
-
172
- - add basic support for bpmn:Property, bpmn:DataStore, and bpmn:DataStoreReference
173
-
174
- # 5.1.3
175
-
176
- - bump smqp to even less CPU intense version
177
- - fix shake routing key pattern bug
178
-
179
- # 5.1.2
180
-
181
- - stop building with node 10 (mocha)
182
- - bump smqp to less CPU intense version
183
-
184
- # 5.1.1
185
-
186
- Sequential loop trouble.
187
-
188
- ## Bugfix
189
- - Fix nasty bug in sequential multi-instance loop where it ran to infinity when cardinality is set to 0. Thank you @deelef for uncovering this!
190
- - set cardinality to collection length if cardinality expression resolved to nothing
191
-
192
- # 5.1.0
193
-
194
- - Support `bpmn:Group` as dummy placeholder
195
- - Support `bpmn:Category` as dummy placeholder
196
-
197
- # 5.0.1
198
-
199
- Improved expression handling by @javierlopezaircall
200
-
201
- - expression function call with string argument containing commas is now supported
202
-
203
- # 5.0.0
204
-
205
- Multi-/Standard-loop characteristics.
206
-
207
- ## Breaking
208
- - Cardinality and/or a collection is now required if designing a parallel multi instance loop
209
- - Start throwing error when cardinality is invalid, so no need for TS yet...
210
-
211
- ## Addititions
212
- - Introduce new setting to control parallel loop batch size, defaults to 50
213
-
214
- ## Bugfix
215
- - Fixed bug where multi instance parallel loop stalled when more than 100 iterations where required
216
-
217
- # 4.4.2
218
-
219
- - wrestling with 4.4.1 edge case
220
-
221
- # 4.4.1
222
-
223
- - smqp retains undelivered execute.timer message in exchange when state is saved... eh, just fixed resume timers hard-to-explain-edge-case
224
-
225
- # 4.4.0
226
-
227
- improve expression handling
228
-
229
- - cover false as expression function argument
230
-
231
- # 4.3.4
232
-
233
- - Fix multiple start events not completing process. Diverging flows to different ends stalled execution
234
-
235
- # 4.3.3
236
-
237
- - Bump `smqp@3.2`
238
-
239
- # 4.3.2
240
-
241
- - For some anxious reason parallel join gateways were initialized over and over again when inbound flows were touched. This stops now. A recovered and resumed run can now continue instead of waiting for neurotic joins. Thankyou @mdwheele for this discovery.
242
-
243
- # 4.3.1
244
-
245
- - Stop throwing errors when failing to parse `timeDuration` or `timeDate` as it was before and still should've been before someone changed it
246
-
247
- # 4.3.0
248
-
249
- Timetracking
250
-
251
- - New [environment](/docs/Environment.md) [timers]((/docs/Timers.md)) property with tracked `setTimeout` and `clearTimeout`. Used by TimerEventDefinition and by inline scripts if necessary
252
-
253
- # 4.2.0
254
-
255
- Flaky formatting
256
-
257
- - Add tests for formatting workaround by publishing directly to `format-run-q`
258
- - Support formatting failure by adding `errorRoutingKey` or just publish format message with routing key ending in `.error`
259
-
260
- # 4.1.4
261
-
262
- Outbound sequence flows again.
263
-
264
- - Remove redundant outbound sequence flow logic in Inclusive- and ExclusiveGateway. Flag ExclusiveGateway that only one should be taken
265
- - If no outbound sequence was taken when activity completes the activity will throw. As it did in the above gateways. This might break stuff, but I guess it actually should
266
-
267
- # 4.1.3
268
-
269
- ## Bugfix
270
- - Wrap conditional sequence flow script error in an Activity error
271
-
272
- # 4.1.2
273
-
274
- ## Bugfix
275
- - Return something else than undefined when calling definition run (!). The definition is returned.
276
-
277
- # 4.1.1
278
-
279
- ## Bugfix
280
- - Formatting message on activity end resulted in nasty bug where outbound flows were affected and run stopped prematurely. This stops now.
281
-
282
- # 4.1.0
283
-
284
- - Make sure resumed activity wait events are emitted with a flag indicating that they are resumed - `content.isRecovered`. Can facilitate decisions regarding save state and stop. A more proper name would've been `isResumed` but `isRecovered` was used by `SignalTask`. No need for a breaking major for this small addition
285
-
286
- # 4.0.0
287
-
288
- Refactor scripts again
289
-
290
- ## Breaking
291
- - ScriptTask now requires that a script is returned by [Script handler](/docs/Scripts.md) can off course return a dummy function
292
- - Conditional SequnceFlow respects script if returned by script handler
293
-
294
- # 3.1.0
295
-
296
- - All sequence flows with condition, regardless of language, can use script condition using [register function](/docs/Scripts.md#registeractivity). If condition language is stipulated then script is required.
297
-
298
- # 3.0.0
299
-
300
- ## Breaking
301
- - Outbound sequence flow with script condition requires `next(err, result)` to be called where result decides if it should be taken or discarded
302
-
303
- ## Addititions
304
- - Outbound sequence flow conditions are evaluated for all activities, as well as default flow
305
- - Process now also have `cancelActivity` function for facilitation
306
-
307
- # 2.1.0
308
-
309
- Transactions and compensation if cancelled.
310
-
311
- ## Additions
312
- - Add support for Transaction
313
- - Add support for CancelEventDefinition
314
-
315
- # 2.0.0
316
-
317
- Diagram sequence flow order affects recover as per [engine issue 105](https://github.com/paed01/bpmn-engine/issues/105).
318
-
319
- - Refactored outbound flow handling to an extent that flows are now taken and discarded before leaving the activity run
320
- - As an effect of above - SequenceFlow pre flight event disappeared
321
- - Bonus: Make EventBasedGateway behave as it should
322
-
323
- # 1.6.1
324
-
325
- ## Bugfix:
326
- - Resumed definition with multiple loopbacks ran towards infinity, thats now finit as expected since there is an end to the fun. Thankyou @aowakennomai for uncovering bug
327
-
328
- # 1.6.0
329
-
330
- - Publish `definition.resume` event when Definition is resumed
331
-
332
- # 1.5.0
333
-
334
- - Include input when throwing signal or message
335
-
336
- # 1.4.0
337
-
338
- Run a non-executable process.
339
-
340
- ## Additions
341
- - Add support for runnning a process that is NOT marked as executable by calling `definition.run({processId})`
342
-
343
- ## Bugfix
344
- - Multiple start events were not resumed in an orderly fashion when recovered, process was stuck, but is no more
345
- - Include occasional sub process sequence when shaking activities
346
-
347
- # 1.3.0
348
-
349
- [TimerEventDefinition](/docs/TimerEventDefinition.md) `timeDate` and `timeCycle`.
350
-
351
- ## Additions
352
- - Add support for TimerEventDefinition `timeDate`. Will behave like `timeDuration` unless the date is due - timeout
353
- - TimerEventDefinition `timeCycle` is recognized but no timer is started. The non-action is due to uncertainty regarding cycle format. The event definition is stalled and waits for cancel
354
- - New [`cancelActivity`](/docs/Definition.md#cancelactivitymessage) function is added to definition
355
- - TimerEventDefinition now recognises api cancel calls. Which comes in handy if a time cycle is identified and needs to continue
356
-
357
- # 1.2.0
358
-
359
- - a start event with form that is waiting for input can now also be signaled from definition
360
-
361
- # 1.1.0
362
-
363
- ## Additions
364
- - Add shake functionality to [definition](/docs/Definition.md) to facilitate getting the run sequences of an activity or processes by calling `definition.shake([activityId])`
365
-
366
- ## Patch
367
- - Bump to smqp@3
368
- - Patch copyright year
369
-
370
- # 1.0.0
371
-
372
- Make it easier and possible to signal activities from [definition](/docs/Definition.md) by calling `definition.signal(message)`.
373
-
374
- ## Breaking
375
- - MessageEventDefinition and SignalEventDefinition will only listens for pre-execution messages if contained in a starting event
376
-
377
- ## Bugfix
378
- - Parallel looped ReceiveTask iterations all completed with one message, that was not intended and doesn't anymore. One message equals one completed iteration
379
-
380
- ## Minor
381
- - Bump to smqp@2.2
382
- - Bump dev dependencies
383
-
384
- # 0.13.1
385
-
386
- - Bump to smqp@2
387
- - Bump dev dependencies
388
-
389
- # 0.12.1
390
-
391
- - Patch `moddle-context-serializer` to relieve project from nasty bug where message flows sourcing from empty lane threw find of undefined
392
-
393
- # 0.12.0
394
-
395
- - Allow override of default expression handling and parsing
396
- - Map BusinessRuleTask to ServiceTask
397
-
398
- # 0.11.0
399
-
400
- - Execute extensions when initiating process
401
-
402
- # 0.10.0
403
-
404
- - Recover now recovers environment as well
405
-
406
- ## Bugfix
407
- - getting state no longer throws if a placeholder activity is in activities
408
-
409
- # 0.9.0
410
-
411
- ## Addition
412
- - Compensation is now supported, but only by association
413
-
414
- ## Bugfix
415
- - Fix weird code where context ignores passed SequenceFlow and MessageFlow Behaviour function when making new instances
416
-
417
- # 0.8.1
418
-
419
- - Expose SequenceFlow name in published events and in api
420
-
421
- # 0.8.0
422
-
423
- - Support StandardLoopCondition
424
-
425
- # 0.7.0
426
-
427
- - Support LinkEventDefinition
428
-
429
- # 0.6.1
430
-
431
- - Defensive resume #8
432
-
433
- # 0.6.0
434
-
435
- Focused on messaging.
436
-
437
- ## Breaking
438
- - ReceiveTask expects referenced message, it can still be signaled
439
- - IntermediateCatchEvent that lacks event definitions now expects to be signaled
440
- - Catching MessageEventDefinition expects referenced message. or at least a matching message id
441
-
442
- ## Additions
443
- - IntermediateThrowEvent with MessageEventDefinition now throws Message
444
- - Start activities conforming to the same flow is discarded when the flow reaches an end activity, unless a join is put in between
445
-
446
- # 0.5.0
447
-
448
- - allow a waiting UserTask to trigger an execution error
449
- - catch signal fired before event execution
450
-
451
- # 0.4.0
452
-
453
- ## Breaking
454
- - Catching ErrorEventDefinition now catches BpmnErrors. Support for catching by error code and anonymous errors is still supported
455
- - Event with throwing ErrorEventDefinition now throws non-fatal BpmnErrors
456
-
457
- ## Additions
458
- - Expose element name on Api
459
- - Extension function `deactivate` is now actually called, called on leave and stop
@@ -1,42 +0,0 @@
1
- const kActivated = Symbol.for('activated');
2
-
3
- export default function ExtensionsMapper(context) {
4
- this.context = context;
5
- }
6
-
7
- ExtensionsMapper.prototype.get = function get(activity) {
8
- return new Extensions(activity, this.context, this._getExtensions());
9
- };
10
-
11
- ExtensionsMapper.prototype._getExtensions = function getExtensions() {
12
- let extensions;
13
- if (!(extensions = this.context.environment.extensions)) return [];
14
- return Object.values(extensions);
15
- };
16
-
17
- function Extensions(activity, context, extensions) {
18
- const result = this.extensions = [];
19
- for (const Extension of extensions) {
20
- const extension = Extension(activity, context);
21
- if (extension) result.push(extension);
22
- }
23
- this[kActivated] = false;
24
- }
25
-
26
- Object.defineProperty(Extensions.prototype, 'count', {
27
- get() {
28
- return this.extensions.length;
29
- },
30
- });
31
-
32
- Extensions.prototype.activate = function activate(message) {
33
- if (this[kActivated]) return;
34
- this[kActivated] = true;
35
- for (const extension of this.extensions) extension.activate(message);
36
- };
37
-
38
- Extensions.prototype.deactivate = function deactivate(message) {
39
- if (!this[kActivated]) return;
40
- this[kActivated] = false;
41
- for (const extension of this.extensions) extension.deactivate(message);
42
- };