From b346a24651bcb6c2cfb2ee62cd81452f3e8d8798 Mon Sep 17 00:00:00 2001
From: Daniel <150448993+sombrek@users.noreply.github.com>
Date: Fri, 30 Aug 2024 17:47:41 +0200
Subject: [PATCH] feat(simulator): support catch-all error and escalation
events
---
lib/simulator/Simulator.js | 17 +-
lib/simulator/util/EventsUtil.js | 10 +-
...mulator.error-catch-all-boundary-none.bpmn | 134 +++++++++++
...mulator.error-catch-all-boundary-none.json | 41 ++++
...imulator.error-catch-all-boundary-ref.bpmn | 156 +++++++++++++
...imulator.error-catch-all-boundary-ref.json | 41 ++++
....error-catch-all-inner-event-sub-none.bpmn | 182 +++++++++++++++
....error-catch-all-inner-event-sub-none.json | 53 +++++
...r.error-catch-all-inner-event-sub-ref.bpmn | 208 +++++++++++++++++
...r.error-catch-all-inner-event-sub-ref.json | 53 +++++
...or.escalation-catch-all-boundary-none.bpmn | 146 ++++++++++++
...or.escalation-catch-all-boundary-none.json | 41 ++++
...tor.escalation-catch-all-boundary-ref.bpmn | 168 +++++++++++++
...tor.escalation-catch-all-boundary-ref.json | 41 ++++
...lation-catch-all-inner-event-sub-none.bpmn | 194 +++++++++++++++
...lation-catch-all-inner-event-sub-none.json | 53 +++++
...alation-catch-all-inner-event-sub-ref.bpmn | 220 ++++++++++++++++++
...alation-catch-all-inner-event-sub-ref.json | 53 +++++
...lation-catch-all-outer-event-sub-none.bpmn | 98 ++++++++
...lation-catch-all-outer-event-sub-none.json | 44 ++++
...alation-catch-all-outer-event-sub-ref.bpmn | 124 ++++++++++
...alation-catch-all-outer-event-sub-ref.json | 44 ++++
test/spec/simulator/SimulatorSpec.js | 120 ++++++++++
23 files changed, 2238 insertions(+), 3 deletions(-)
create mode 100644 test/spec/simulator/Simulator.error-catch-all-boundary-none.bpmn
create mode 100644 test/spec/simulator/Simulator.error-catch-all-boundary-none.json
create mode 100644 test/spec/simulator/Simulator.error-catch-all-boundary-ref.bpmn
create mode 100644 test/spec/simulator/Simulator.error-catch-all-boundary-ref.json
create mode 100644 test/spec/simulator/Simulator.error-catch-all-inner-event-sub-none.bpmn
create mode 100644 test/spec/simulator/Simulator.error-catch-all-inner-event-sub-none.json
create mode 100644 test/spec/simulator/Simulator.error-catch-all-inner-event-sub-ref.bpmn
create mode 100644 test/spec/simulator/Simulator.error-catch-all-inner-event-sub-ref.json
create mode 100644 test/spec/simulator/Simulator.escalation-catch-all-boundary-none.bpmn
create mode 100644 test/spec/simulator/Simulator.escalation-catch-all-boundary-none.json
create mode 100644 test/spec/simulator/Simulator.escalation-catch-all-boundary-ref.bpmn
create mode 100644 test/spec/simulator/Simulator.escalation-catch-all-boundary-ref.json
create mode 100644 test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-none.bpmn
create mode 100644 test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-none.json
create mode 100644 test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-ref.bpmn
create mode 100644 test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-ref.json
create mode 100644 test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-none.bpmn
create mode 100644 test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-none.json
create mode 100644 test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-ref.bpmn
create mode 100644 test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-ref.json
diff --git a/lib/simulator/Simulator.js b/lib/simulator/Simulator.js
index b3237356..c35560d9 100644
--- a/lib/simulator/Simulator.js
+++ b/lib/simulator/Simulator.js
@@ -9,7 +9,8 @@ import {
} from './util/SetUtil';
import {
- eventsMatch
+ eventsMatch,
+ refsMatch
} from './util/EventsUtil';
import {
@@ -216,10 +217,22 @@ export default function Simulator(injector, eventBus, elementRegistry) {
const subscriptions = scope.subscriptions;
- const matchingSubscriptions = filterSet(
+ let matchingSubscriptions = filterSet(
subscriptions, subscription => eventsMatch(event, subscription.event)
);
+ if (event.type === 'error' || event.type === 'escalation') {
+ const referenceSubscriptions = filterSet(
+ matchingSubscriptions, subscription => refsMatch(event, subscription.event)
+ );
+
+ if (matchingSubscriptions.every(subscription => subscription.event.boundary)
+ && referenceSubscriptions.some(subscription => subscription.event.boundary)
+ || referenceSubscriptions.some(subscription => !subscription.event.boundary)) {
+ matchingSubscriptions = referenceSubscriptions;
+ }
+ }
+
const nonInterrupting = matchingSubscriptions.filter(
subscription => !subscription.event.interrupting
);
diff --git a/lib/simulator/util/EventsUtil.js b/lib/simulator/util/EventsUtil.js
index 46fe06ef..5b7ca2c6 100644
--- a/lib/simulator/util/EventsUtil.js
+++ b/lib/simulator/util/EventsUtil.js
@@ -1,3 +1,11 @@
export function eventsMatch(a, b) {
- return [ 'type', 'name', 'ref', 'iref' ].every(attr => !(attr in a) || a[attr] === b[attr]);
+ const attrMatch = [ 'type', 'name', 'iref' ].every(attr => !(attr in a) || a[attr] === b[attr]);
+ const catchAllMatch = !b.ref && (b.type === 'error' || b.type === 'escalation');
+
+ return attrMatch && (catchAllMatch || refsMatch(a, b));
+}
+
+export function refsMatch(a, b) {
+ const attr = 'ref';
+ return !(attr in a) || a[attr] === b[attr];
}
\ No newline at end of file
diff --git a/test/spec/simulator/Simulator.error-catch-all-boundary-none.bpmn b/test/spec/simulator/Simulator.error-catch-all-boundary-none.bpmn
new file mode 100644
index 00000000..58d250e8
--- /dev/null
+++ b/test/spec/simulator/Simulator.error-catch-all-boundary-none.bpmn
@@ -0,0 +1,134 @@
+
+
+
+
+ Flow_1
+
+
+ Flow_1
+ Flow_4
+
+ Flow_2
+
+
+
+ Flow_2
+
+
+
+
+
+ Flow_4
+
+
+
+ Flow_9
+
+
+
+
+ Flow_7
+
+
+
+ Flow_7
+
+
+
+
+
+ Flow_8
+
+
+
+ Flow_8
+
+
+
+
+ Flow_9
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/spec/simulator/Simulator.error-catch-all-boundary-none.json b/test/spec/simulator/Simulator.error-catch-all-boundary-none.json
new file mode 100644
index 00000000..ef7f09b4
--- /dev/null
+++ b/test/spec/simulator/Simulator.error-catch-all-boundary-none.json
@@ -0,0 +1,41 @@
+[
+ "createScope:Process_1:null",
+ "signal:Process_1:B",
+ "createScope:StartEvent_1:B",
+ "signal:StartEvent_1:C",
+ "exit:StartEvent_1:C",
+ "createScope:Flow_1:B",
+ "destroyScope:StartEvent_1:C",
+ "enter:Flow_1:B",
+ "exit:Flow_1:D",
+ "createScope:SubProcess:B",
+ "destroyScope:Flow_1:D",
+ "enter:SubProcess:B",
+ "createScope:StartEvent_2:E",
+ "signal:StartEvent_2:F",
+ "exit:StartEvent_2:F",
+ "createScope:Flow_2:E",
+ "destroyScope:StartEvent_2:F",
+ "enter:Flow_2:E",
+ "exit:Flow_2:G",
+ "createScope:ErrorEndEvent_1:E",
+ "destroyScope:Flow_2:G",
+ "enter:ErrorEndEvent_1:E",
+ "createScope:ErrorBoundary_none:B",
+ "signal:ErrorBoundary_none:I",
+ "destroyScope:ErrorEndEvent_1:H",
+ "exit:SubProcess:E",
+ "destroyScope:SubProcess:E",
+ "exit:ErrorBoundary_none:I",
+ "createScope:Flow_9:B",
+ "destroyScope:ErrorBoundary_none:I",
+ "enter:Flow_9:B",
+ "exit:Flow_9:J",
+ "createScope:EndEvent_7:B",
+ "destroyScope:Flow_9:J",
+ "enter:EndEvent_7:B",
+ "exit:EndEvent_7:K",
+ "destroyScope:EndEvent_7:K",
+ "exit:Process_1:B",
+ "destroyScope:Process_1:B"
+]
\ No newline at end of file
diff --git a/test/spec/simulator/Simulator.error-catch-all-boundary-ref.bpmn b/test/spec/simulator/Simulator.error-catch-all-boundary-ref.bpmn
new file mode 100644
index 00000000..60e4d7b2
--- /dev/null
+++ b/test/spec/simulator/Simulator.error-catch-all-boundary-ref.bpmn
@@ -0,0 +1,156 @@
+
+
+
+
+ Flow_1
+
+
+ Flow_1
+ Flow_4
+
+ Flow_2
+
+
+
+ Flow_2
+
+
+
+
+
+ Flow_4
+
+
+
+ Flow_9
+
+
+
+ Flow_10
+
+
+
+
+ Flow_7
+
+
+
+ Flow_7
+
+
+
+
+
+ Flow_8
+
+
+
+ Flow_8
+
+
+
+
+ Flow_9
+
+
+
+ Flow_10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/spec/simulator/Simulator.error-catch-all-boundary-ref.json b/test/spec/simulator/Simulator.error-catch-all-boundary-ref.json
new file mode 100644
index 00000000..998ebc8f
--- /dev/null
+++ b/test/spec/simulator/Simulator.error-catch-all-boundary-ref.json
@@ -0,0 +1,41 @@
+[
+ "createScope:Process_1:null",
+ "signal:Process_1:B",
+ "createScope:StartEvent_1:B",
+ "signal:StartEvent_1:C",
+ "exit:StartEvent_1:C",
+ "createScope:Flow_1:B",
+ "destroyScope:StartEvent_1:C",
+ "enter:Flow_1:B",
+ "exit:Flow_1:D",
+ "createScope:SubProcess:B",
+ "destroyScope:Flow_1:D",
+ "enter:SubProcess:B",
+ "createScope:StartEvent_2:E",
+ "signal:StartEvent_2:F",
+ "exit:StartEvent_2:F",
+ "createScope:Flow_2:E",
+ "destroyScope:StartEvent_2:F",
+ "enter:Flow_2:E",
+ "exit:Flow_2:G",
+ "createScope:ErrorEndEvent_1:E",
+ "destroyScope:Flow_2:G",
+ "enter:ErrorEndEvent_1:E",
+ "createScope:ErrorBoundary_123:B",
+ "signal:ErrorBoundary_123:I",
+ "destroyScope:ErrorEndEvent_1:H",
+ "exit:SubProcess:E",
+ "destroyScope:SubProcess:E",
+ "exit:ErrorBoundary_123:I",
+ "createScope:Flow_10:B",
+ "destroyScope:ErrorBoundary_123:I",
+ "enter:Flow_10:B",
+ "exit:Flow_10:J",
+ "createScope:EndEvent_8:B",
+ "destroyScope:Flow_10:J",
+ "enter:EndEvent_8:B",
+ "exit:EndEvent_8:K",
+ "destroyScope:EndEvent_8:K",
+ "exit:Process_1:B",
+ "destroyScope:Process_1:B"
+]
\ No newline at end of file
diff --git a/test/spec/simulator/Simulator.error-catch-all-inner-event-sub-none.bpmn b/test/spec/simulator/Simulator.error-catch-all-inner-event-sub-none.bpmn
new file mode 100644
index 00000000..88be01ab
--- /dev/null
+++ b/test/spec/simulator/Simulator.error-catch-all-inner-event-sub-none.bpmn
@@ -0,0 +1,182 @@
+
+
+
+
+ Flow_1
+
+
+ Flow_1
+ Flow_4
+
+ Flow_2
+
+
+
+
+ Flow_5
+
+
+
+ Flow_5
+
+
+
+
+ Flow_2
+
+
+
+
+
+ Flow_4
+
+
+
+ Flow_9
+
+
+
+ Flow_10
+
+
+
+
+ Flow_7
+
+
+
+ Flow_7
+
+
+
+
+
+ Flow_8
+
+
+
+ Flow_8
+
+
+
+
+ Flow_9
+
+
+
+ Flow_10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/spec/simulator/Simulator.error-catch-all-inner-event-sub-none.json b/test/spec/simulator/Simulator.error-catch-all-inner-event-sub-none.json
new file mode 100644
index 00000000..320918c3
--- /dev/null
+++ b/test/spec/simulator/Simulator.error-catch-all-inner-event-sub-none.json
@@ -0,0 +1,53 @@
+[
+ "createScope:Process_1:null",
+ "signal:Process_1:B",
+ "createScope:StartEvent_1:B",
+ "signal:StartEvent_1:C",
+ "exit:StartEvent_1:C",
+ "createScope:Flow_1:B",
+ "destroyScope:StartEvent_1:C",
+ "enter:Flow_1:B",
+ "exit:Flow_1:D",
+ "createScope:SubProcess:B",
+ "destroyScope:Flow_1:D",
+ "enter:SubProcess:B",
+ "createScope:StartEvent_2:E",
+ "signal:StartEvent_2:F",
+ "exit:StartEvent_2:F",
+ "createScope:Flow_2:E",
+ "destroyScope:StartEvent_2:F",
+ "enter:Flow_2:E",
+ "exit:Flow_2:G",
+ "createScope:ErrorEndEvent_1:E",
+ "destroyScope:Flow_2:G",
+ "enter:ErrorEndEvent_1:E",
+ "createScope:EventSubProcess_1:E",
+ "signal:EventSubProcess_1:I",
+ "destroyScope:ErrorEndEvent_1:H",
+ "createScope:InnerErrorStart_none:I",
+ "signal:InnerErrorStart_none:J",
+ "exit:InnerErrorStart_none:J",
+ "createScope:Flow_5:I",
+ "destroyScope:InnerErrorStart_none:J",
+ "enter:Flow_5:I",
+ "exit:Flow_5:K",
+ "createScope:EndEvent_3:I",
+ "destroyScope:Flow_5:K",
+ "enter:EndEvent_3:I",
+ "exit:EndEvent_3:L",
+ "destroyScope:EndEvent_3:L",
+ "exit:EventSubProcess_1:I",
+ "destroyScope:EventSubProcess_1:I",
+ "exit:SubProcess:E",
+ "createScope:Flow_4:B",
+ "destroyScope:SubProcess:E",
+ "enter:Flow_4:B",
+ "exit:Flow_4:M",
+ "createScope:EndEvent_2:B",
+ "destroyScope:Flow_4:M",
+ "enter:EndEvent_2:B",
+ "exit:EndEvent_2:N",
+ "destroyScope:EndEvent_2:N",
+ "exit:Process_1:B",
+ "destroyScope:Process_1:B"
+]
\ No newline at end of file
diff --git a/test/spec/simulator/Simulator.error-catch-all-inner-event-sub-ref.bpmn b/test/spec/simulator/Simulator.error-catch-all-inner-event-sub-ref.bpmn
new file mode 100644
index 00000000..669b2e67
--- /dev/null
+++ b/test/spec/simulator/Simulator.error-catch-all-inner-event-sub-ref.bpmn
@@ -0,0 +1,208 @@
+
+
+
+
+ Flow_1
+
+
+ Flow_1
+ Flow_4
+
+ Flow_2
+
+
+
+
+ Flow_5
+
+
+
+ Flow_5
+
+
+
+
+
+ Flow_6
+
+
+
+ Flow_6
+
+
+
+
+ Flow_2
+
+
+
+
+
+ Flow_4
+
+
+
+ Flow_9
+
+
+
+ Flow_10
+
+
+
+
+ Flow_7
+
+
+
+ Flow_7
+
+
+
+
+
+ Flow_8
+
+
+
+ Flow_8
+
+
+
+
+ Flow_9
+
+
+
+ Flow_10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/spec/simulator/Simulator.error-catch-all-inner-event-sub-ref.json b/test/spec/simulator/Simulator.error-catch-all-inner-event-sub-ref.json
new file mode 100644
index 00000000..a482b842
--- /dev/null
+++ b/test/spec/simulator/Simulator.error-catch-all-inner-event-sub-ref.json
@@ -0,0 +1,53 @@
+[
+ "createScope:Process_1:null",
+ "signal:Process_1:B",
+ "createScope:StartEvent_1:B",
+ "signal:StartEvent_1:C",
+ "exit:StartEvent_1:C",
+ "createScope:Flow_1:B",
+ "destroyScope:StartEvent_1:C",
+ "enter:Flow_1:B",
+ "exit:Flow_1:D",
+ "createScope:SubProcess:B",
+ "destroyScope:Flow_1:D",
+ "enter:SubProcess:B",
+ "createScope:StartEvent_2:E",
+ "signal:StartEvent_2:F",
+ "exit:StartEvent_2:F",
+ "createScope:Flow_2:E",
+ "destroyScope:StartEvent_2:F",
+ "enter:Flow_2:E",
+ "exit:Flow_2:G",
+ "createScope:ErrorEndEvent_1:E",
+ "destroyScope:Flow_2:G",
+ "enter:ErrorEndEvent_1:E",
+ "createScope:EventSubProcess_2:E",
+ "signal:EventSubProcess_2:I",
+ "destroyScope:ErrorEndEvent_1:H",
+ "createScope:InnerErrorStart_123:I",
+ "signal:InnerErrorStart_123:J",
+ "exit:InnerErrorStart_123:J",
+ "createScope:Flow_6:I",
+ "destroyScope:InnerErrorStart_123:J",
+ "enter:Flow_6:I",
+ "exit:Flow_6:K",
+ "createScope:EndEvent_4:I",
+ "destroyScope:Flow_6:K",
+ "enter:EndEvent_4:I",
+ "exit:EndEvent_4:L",
+ "destroyScope:EndEvent_4:L",
+ "exit:EventSubProcess_2:I",
+ "destroyScope:EventSubProcess_2:I",
+ "exit:SubProcess:E",
+ "createScope:Flow_4:B",
+ "destroyScope:SubProcess:E",
+ "enter:Flow_4:B",
+ "exit:Flow_4:M",
+ "createScope:EndEvent_2:B",
+ "destroyScope:Flow_4:M",
+ "enter:EndEvent_2:B",
+ "exit:EndEvent_2:N",
+ "destroyScope:EndEvent_2:N",
+ "exit:Process_1:B",
+ "destroyScope:Process_1:B"
+]
\ No newline at end of file
diff --git a/test/spec/simulator/Simulator.escalation-catch-all-boundary-none.bpmn b/test/spec/simulator/Simulator.escalation-catch-all-boundary-none.bpmn
new file mode 100644
index 00000000..10e09cde
--- /dev/null
+++ b/test/spec/simulator/Simulator.escalation-catch-all-boundary-none.bpmn
@@ -0,0 +1,146 @@
+
+
+
+
+ Flow_1
+
+
+ Flow_1
+ Flow_4
+
+ Flow_2
+
+
+
+ Flow_3
+
+
+
+ Flow_2
+ Flow_3
+
+
+
+
+
+ Flow_4
+
+
+
+ Flow_9
+
+
+
+ Flow_9
+
+
+
+
+ Flow_7
+
+
+
+ Flow_7
+
+
+
+
+
+ Flow_8
+
+
+
+ Flow_8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/spec/simulator/Simulator.escalation-catch-all-boundary-none.json b/test/spec/simulator/Simulator.escalation-catch-all-boundary-none.json
new file mode 100644
index 00000000..5c9c508c
--- /dev/null
+++ b/test/spec/simulator/Simulator.escalation-catch-all-boundary-none.json
@@ -0,0 +1,41 @@
+[
+ "createScope:Process_1:null",
+ "signal:Process_1:B",
+ "createScope:StartEvent_1:B",
+ "signal:StartEvent_1:C",
+ "exit:StartEvent_1:C",
+ "createScope:Flow_1:B",
+ "destroyScope:StartEvent_1:C",
+ "enter:Flow_1:B",
+ "exit:Flow_1:D",
+ "createScope:SubProcess:B",
+ "destroyScope:Flow_1:D",
+ "enter:SubProcess:B",
+ "createScope:StartEvent_2:E",
+ "signal:StartEvent_2:F",
+ "exit:StartEvent_2:F",
+ "createScope:Flow_2:E",
+ "destroyScope:StartEvent_2:F",
+ "enter:Flow_2:E",
+ "exit:Flow_2:G",
+ "createScope:Event_1vfmjkk:E",
+ "destroyScope:Flow_2:G",
+ "enter:Event_1vfmjkk:E",
+ "createScope:EscalationBoundary_none:B",
+ "signal:EscalationBoundary_none:I",
+ "destroyScope:Event_1vfmjkk:H",
+ "exit:SubProcess:E",
+ "destroyScope:SubProcess:E",
+ "exit:EscalationBoundary_none:I",
+ "createScope:Flow_9:B",
+ "destroyScope:EscalationBoundary_none:I",
+ "enter:Flow_9:B",
+ "exit:Flow_9:J",
+ "createScope:EndEvent_7:B",
+ "destroyScope:Flow_9:J",
+ "enter:EndEvent_7:B",
+ "exit:EndEvent_7:K",
+ "destroyScope:EndEvent_7:K",
+ "exit:Process_1:B",
+ "destroyScope:Process_1:B"
+]
\ No newline at end of file
diff --git a/test/spec/simulator/Simulator.escalation-catch-all-boundary-ref.bpmn b/test/spec/simulator/Simulator.escalation-catch-all-boundary-ref.bpmn
new file mode 100644
index 00000000..236911f0
--- /dev/null
+++ b/test/spec/simulator/Simulator.escalation-catch-all-boundary-ref.bpmn
@@ -0,0 +1,168 @@
+
+
+
+
+ Flow_1
+
+
+ Flow_1
+ Flow_4
+
+ Flow_2
+
+
+
+ Flow_3
+
+
+
+ Flow_2
+ Flow_3
+
+
+
+
+
+ Flow_4
+
+
+
+ Flow_9
+
+
+
+ Flow_10
+
+
+
+ Flow_9
+
+
+
+ Flow_10
+
+
+
+
+ Flow_7
+
+
+
+ Flow_7
+
+
+
+
+
+ Flow_8
+
+
+
+ Flow_8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/spec/simulator/Simulator.escalation-catch-all-boundary-ref.json b/test/spec/simulator/Simulator.escalation-catch-all-boundary-ref.json
new file mode 100644
index 00000000..c45d2c76
--- /dev/null
+++ b/test/spec/simulator/Simulator.escalation-catch-all-boundary-ref.json
@@ -0,0 +1,41 @@
+[
+ "createScope:Process_1:null",
+ "signal:Process_1:B",
+ "createScope:StartEvent_1:B",
+ "signal:StartEvent_1:C",
+ "exit:StartEvent_1:C",
+ "createScope:Flow_1:B",
+ "destroyScope:StartEvent_1:C",
+ "enter:Flow_1:B",
+ "exit:Flow_1:D",
+ "createScope:SubProcess:B",
+ "destroyScope:Flow_1:D",
+ "enter:SubProcess:B",
+ "createScope:StartEvent_2:E",
+ "signal:StartEvent_2:F",
+ "exit:StartEvent_2:F",
+ "createScope:Flow_2:E",
+ "destroyScope:StartEvent_2:F",
+ "enter:Flow_2:E",
+ "exit:Flow_2:G",
+ "createScope:Event_1vfmjkk:E",
+ "destroyScope:Flow_2:G",
+ "enter:Event_1vfmjkk:E",
+ "createScope:EscalationBoundary_123:B",
+ "signal:EscalationBoundary_123:I",
+ "destroyScope:Event_1vfmjkk:H",
+ "exit:SubProcess:E",
+ "destroyScope:SubProcess:E",
+ "exit:EscalationBoundary_123:I",
+ "createScope:Flow_10:B",
+ "destroyScope:EscalationBoundary_123:I",
+ "enter:Flow_10:B",
+ "exit:Flow_10:J",
+ "createScope:EndEvent_8:B",
+ "destroyScope:Flow_10:J",
+ "enter:EndEvent_8:B",
+ "exit:EndEvent_8:K",
+ "destroyScope:EndEvent_8:K",
+ "exit:Process_1:B",
+ "destroyScope:Process_1:B"
+]
\ No newline at end of file
diff --git a/test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-none.bpmn b/test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-none.bpmn
new file mode 100644
index 00000000..b1a6ee48
--- /dev/null
+++ b/test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-none.bpmn
@@ -0,0 +1,194 @@
+
+
+
+
+ Flow_1
+
+
+ Flow_1
+ Flow_4
+
+ Flow_2
+
+
+
+ Flow_3
+
+
+
+ Flow_2
+ Flow_3
+
+
+
+
+ Flow_5
+
+
+
+ Flow_5
+
+
+
+
+
+
+ Flow_4
+
+
+
+ Flow_9
+
+
+
+ Flow_10
+
+
+
+ Flow_9
+
+
+
+ Flow_10
+
+
+
+
+ Flow_7
+
+
+
+ Flow_7
+
+
+
+
+
+ Flow_8
+
+
+
+ Flow_8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-none.json b/test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-none.json
new file mode 100644
index 00000000..5f154ab0
--- /dev/null
+++ b/test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-none.json
@@ -0,0 +1,53 @@
+[
+ "createScope:Process_1:null",
+ "signal:Process_1:B",
+ "createScope:StartEvent_1:B",
+ "signal:StartEvent_1:C",
+ "exit:StartEvent_1:C",
+ "createScope:Flow_1:B",
+ "destroyScope:StartEvent_1:C",
+ "enter:Flow_1:B",
+ "exit:Flow_1:D",
+ "createScope:SubProcess:B",
+ "destroyScope:Flow_1:D",
+ "enter:SubProcess:B",
+ "createScope:StartEvent_2:E",
+ "signal:StartEvent_2:F",
+ "exit:StartEvent_2:F",
+ "createScope:Flow_2:E",
+ "destroyScope:StartEvent_2:F",
+ "enter:Flow_2:E",
+ "exit:Flow_2:G",
+ "createScope:Event_1vfmjkk:E",
+ "destroyScope:Flow_2:G",
+ "enter:Event_1vfmjkk:E",
+ "createScope:EventSubProcess_1:E",
+ "signal:EventSubProcess_1:I",
+ "destroyScope:Event_1vfmjkk:H",
+ "createScope:InnerEscalationStart_none:I",
+ "signal:InnerEscalationStart_none:J",
+ "exit:InnerEscalationStart_none:J",
+ "createScope:Flow_5:I",
+ "destroyScope:InnerEscalationStart_none:J",
+ "enter:Flow_5:I",
+ "exit:Flow_5:K",
+ "createScope:EndEvent_3:I",
+ "destroyScope:Flow_5:K",
+ "enter:EndEvent_3:I",
+ "exit:EndEvent_3:L",
+ "destroyScope:EndEvent_3:L",
+ "exit:EventSubProcess_1:I",
+ "destroyScope:EventSubProcess_1:I",
+ "exit:SubProcess:E",
+ "createScope:Flow_4:B",
+ "destroyScope:SubProcess:E",
+ "enter:Flow_4:B",
+ "exit:Flow_4:M",
+ "createScope:EndEvent_2:B",
+ "destroyScope:Flow_4:M",
+ "enter:EndEvent_2:B",
+ "exit:EndEvent_2:N",
+ "destroyScope:EndEvent_2:N",
+ "exit:Process_1:B",
+ "destroyScope:Process_1:B"
+]
\ No newline at end of file
diff --git a/test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-ref.bpmn b/test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-ref.bpmn
new file mode 100644
index 00000000..e8da559e
--- /dev/null
+++ b/test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-ref.bpmn
@@ -0,0 +1,220 @@
+
+
+
+
+ Flow_1
+
+
+ Flow_1
+ Flow_4
+
+ Flow_2
+
+
+
+ Flow_3
+
+
+
+ Flow_2
+ Flow_3
+
+
+
+
+ Flow_5
+
+
+
+ Flow_5
+
+
+
+
+
+ Flow_6
+
+
+
+ Flow_6
+
+
+
+
+
+
+ Flow_4
+
+
+
+ Flow_9
+
+
+
+ Flow_10
+
+
+
+ Flow_9
+
+
+
+ Flow_10
+
+
+
+
+ Flow_7
+
+
+
+ Flow_7
+
+
+
+
+
+ Flow_8
+
+
+
+ Flow_8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-ref.json b/test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-ref.json
new file mode 100644
index 00000000..83c3d7a1
--- /dev/null
+++ b/test/spec/simulator/Simulator.escalation-catch-all-inner-event-sub-ref.json
@@ -0,0 +1,53 @@
+[
+ "createScope:Process_1:null",
+ "signal:Process_1:B",
+ "createScope:StartEvent_1:B",
+ "signal:StartEvent_1:C",
+ "exit:StartEvent_1:C",
+ "createScope:Flow_1:B",
+ "destroyScope:StartEvent_1:C",
+ "enter:Flow_1:B",
+ "exit:Flow_1:D",
+ "createScope:SubProcess:B",
+ "destroyScope:Flow_1:D",
+ "enter:SubProcess:B",
+ "createScope:StartEvent_2:E",
+ "signal:StartEvent_2:F",
+ "exit:StartEvent_2:F",
+ "createScope:Flow_2:E",
+ "destroyScope:StartEvent_2:F",
+ "enter:Flow_2:E",
+ "exit:Flow_2:G",
+ "createScope:Event_1vfmjkk:E",
+ "destroyScope:Flow_2:G",
+ "enter:Event_1vfmjkk:E",
+ "createScope:EventSubProcess_2:E",
+ "signal:EventSubProcess_2:I",
+ "destroyScope:Event_1vfmjkk:H",
+ "createScope:InnerEscalationStart_123:I",
+ "signal:InnerEscalationStart_123:J",
+ "exit:InnerEscalationStart_123:J",
+ "createScope:Flow_6:I",
+ "destroyScope:InnerEscalationStart_123:J",
+ "enter:Flow_6:I",
+ "exit:Flow_6:K",
+ "createScope:EndEvent_4:I",
+ "destroyScope:Flow_6:K",
+ "enter:EndEvent_4:I",
+ "exit:EndEvent_4:L",
+ "destroyScope:EndEvent_4:L",
+ "exit:EventSubProcess_2:I",
+ "destroyScope:EventSubProcess_2:I",
+ "exit:SubProcess:E",
+ "createScope:Flow_4:B",
+ "destroyScope:SubProcess:E",
+ "enter:Flow_4:B",
+ "exit:Flow_4:M",
+ "createScope:EndEvent_2:B",
+ "destroyScope:Flow_4:M",
+ "enter:EndEvent_2:B",
+ "exit:EndEvent_2:N",
+ "destroyScope:EndEvent_2:N",
+ "exit:Process_1:B",
+ "destroyScope:Process_1:B"
+]
\ No newline at end of file
diff --git a/test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-none.bpmn b/test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-none.bpmn
new file mode 100644
index 00000000..e44a86ca
--- /dev/null
+++ b/test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-none.bpmn
@@ -0,0 +1,98 @@
+
+
+
+
+ Flow_1
+
+
+ Flow_1
+ Flow_4
+
+ Flow_2
+
+
+
+ Flow_3
+
+
+
+ Flow_2
+ Flow_3
+
+
+
+
+
+ Flow_4
+
+
+
+
+ Flow_7
+
+
+
+ Flow_7
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-none.json b/test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-none.json
new file mode 100644
index 00000000..94276e35
--- /dev/null
+++ b/test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-none.json
@@ -0,0 +1,44 @@
+[
+ "createScope:Process_1:null",
+ "signal:Process_1:B",
+ "createScope:StartEvent_1:B",
+ "signal:StartEvent_1:C",
+ "exit:StartEvent_1:C",
+ "createScope:Flow_1:B",
+ "destroyScope:StartEvent_1:C",
+ "enter:Flow_1:B",
+ "exit:Flow_1:D",
+ "createScope:SubProcess:B",
+ "destroyScope:Flow_1:D",
+ "enter:SubProcess:B",
+ "createScope:StartEvent_2:E",
+ "signal:StartEvent_2:F",
+ "exit:StartEvent_2:F",
+ "createScope:Flow_2:E",
+ "destroyScope:StartEvent_2:F",
+ "enter:Flow_2:E",
+ "exit:Flow_2:G",
+ "createScope:Event_1vfmjkk:E",
+ "destroyScope:Flow_2:G",
+ "enter:Event_1vfmjkk:E",
+ "createScope:EventSubProcess_3:B",
+ "signal:EventSubProcess_3:I",
+ "destroyScope:Event_1vfmjkk:H",
+ "destroyScope:SubProcess:E",
+ "createScope:OuterEscalationStart_none:I",
+ "signal:OuterEscalationStart_none:J",
+ "exit:OuterEscalationStart_none:J",
+ "createScope:Flow_7:I",
+ "destroyScope:OuterEscalationStart_none:J",
+ "enter:Flow_7:I",
+ "exit:Flow_7:K",
+ "createScope:EndEvent_5:I",
+ "destroyScope:Flow_7:K",
+ "enter:EndEvent_5:I",
+ "exit:EndEvent_5:L",
+ "destroyScope:EndEvent_5:L",
+ "exit:EventSubProcess_3:I",
+ "destroyScope:EventSubProcess_3:I",
+ "exit:Process_1:B",
+ "destroyScope:Process_1:B"
+]
\ No newline at end of file
diff --git a/test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-ref.bpmn b/test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-ref.bpmn
new file mode 100644
index 00000000..f1a67066
--- /dev/null
+++ b/test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-ref.bpmn
@@ -0,0 +1,124 @@
+
+
+
+
+ Flow_1
+
+
+ Flow_1
+ Flow_4
+
+ Flow_2
+
+
+
+ Flow_3
+
+
+
+ Flow_2
+ Flow_3
+
+
+
+
+
+ Flow_4
+
+
+
+
+ Flow_7
+
+
+
+ Flow_7
+
+
+
+
+
+ Flow_8
+
+
+
+ Flow_8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-ref.json b/test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-ref.json
new file mode 100644
index 00000000..221c0806
--- /dev/null
+++ b/test/spec/simulator/Simulator.escalation-catch-all-outer-event-sub-ref.json
@@ -0,0 +1,44 @@
+[
+ "createScope:Process_1:null",
+ "signal:Process_1:B",
+ "createScope:StartEvent_1:B",
+ "signal:StartEvent_1:C",
+ "exit:StartEvent_1:C",
+ "createScope:Flow_1:B",
+ "destroyScope:StartEvent_1:C",
+ "enter:Flow_1:B",
+ "exit:Flow_1:D",
+ "createScope:SubProcess:B",
+ "destroyScope:Flow_1:D",
+ "enter:SubProcess:B",
+ "createScope:StartEvent_2:E",
+ "signal:StartEvent_2:F",
+ "exit:StartEvent_2:F",
+ "createScope:Flow_2:E",
+ "destroyScope:StartEvent_2:F",
+ "enter:Flow_2:E",
+ "exit:Flow_2:G",
+ "createScope:Event_1vfmjkk:E",
+ "destroyScope:Flow_2:G",
+ "enter:Event_1vfmjkk:E",
+ "createScope:EventSubProcess_4:B",
+ "signal:EventSubProcess_4:I",
+ "destroyScope:Event_1vfmjkk:H",
+ "destroyScope:SubProcess:E",
+ "createScope:OuterEscalationStart_123:I",
+ "signal:OuterEscalationStart_123:J",
+ "exit:OuterEscalationStart_123:J",
+ "createScope:Flow_8:I",
+ "destroyScope:OuterEscalationStart_123:J",
+ "enter:Flow_8:I",
+ "exit:Flow_8:K",
+ "createScope:EndEvent_6:I",
+ "destroyScope:Flow_8:K",
+ "enter:EndEvent_6:I",
+ "exit:EndEvent_6:L",
+ "destroyScope:EndEvent_6:L",
+ "exit:EventSubProcess_4:I",
+ "destroyScope:EventSubProcess_4:I",
+ "exit:Process_1:B",
+ "destroyScope:Process_1:B"
+]
\ No newline at end of file
diff --git a/test/spec/simulator/SimulatorSpec.js b/test/spec/simulator/SimulatorSpec.js
index ce96d444..9c042798 100644
--- a/test/spec/simulator/SimulatorSpec.js
+++ b/test/spec/simulator/SimulatorSpec.js
@@ -1040,6 +1040,54 @@ describe('simulator', function() {
expectTrace(fixture());
});
+
+ verify('error-catch-all-inner-event-sub-ref', (fixture) => {
+
+ // when
+ trigger({
+ element: element('StartEvent_1')
+ });
+
+ // then
+ expectTrace(fixture());
+ });
+
+
+ verify('error-catch-all-inner-event-sub-none', (fixture) => {
+
+ // when
+ trigger({
+ element: element('StartEvent_1')
+ });
+
+ // then
+ expectTrace(fixture());
+ });
+
+
+ verify('error-catch-all-boundary-ref', (fixture) => {
+
+ // when
+ trigger({
+ element: element('StartEvent_1')
+ });
+
+ // then
+ expectTrace(fixture());
+ });
+
+
+ verify('error-catch-all-boundary-none', (fixture) => {
+
+ // when
+ trigger({
+ element: element('StartEvent_1')
+ });
+
+ // then
+ expectTrace(fixture());
+ });
+
});
@@ -1240,6 +1288,78 @@ describe('simulator', function() {
expectTrace(fixture());
});
+
+ verify('escalation-catch-all-inner-event-sub-ref', (fixture) => {
+
+ // when
+ trigger({
+ element: element('StartEvent_1')
+ });
+
+ // then
+ expectTrace(fixture());
+ });
+
+
+ verify('escalation-catch-all-inner-event-sub-none', (fixture) => {
+
+ // when
+ trigger({
+ element: element('StartEvent_1')
+ });
+
+ // then
+ expectTrace(fixture());
+ });
+
+
+ verify('escalation-catch-all-boundary-ref', (fixture) => {
+
+ // when
+ trigger({
+ element: element('StartEvent_1')
+ });
+
+ // then
+ expectTrace(fixture());
+ });
+
+
+ verify('escalation-catch-all-boundary-none', (fixture) => {
+
+ // when
+ trigger({
+ element: element('StartEvent_1')
+ });
+
+ // then
+ expectTrace(fixture());
+ });
+
+
+ verify('escalation-catch-all-outer-event-sub-ref', (fixture) => {
+
+ // when
+ trigger({
+ element: element('StartEvent_1')
+ });
+
+ // then
+ expectTrace(fixture());
+ });
+
+
+ verify('escalation-catch-all-outer-event-sub-none', (fixture) => {
+
+ // when
+ trigger({
+ element: element('StartEvent_1')
+ });
+
+ // then
+ expectTrace(fixture());
+ });
+
});