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