From 74617c197273378e3f796827280b7a4c39a56d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Kr=C3=A4uter?= Date: Thu, 21 Dec 2023 15:52:02 +0100 Subject: [PATCH] Fake-join and no-implicit-split rule now analyse all activities not only tasks (fixes #125) --- rules/fake-join.js | 2 +- rules/no-implicit-split.js | 2 +- test/rules/fake-join.mjs | 9 +++- .../rules/fake-join/invalid-callActivity.bpmn | 42 +++++++++++++++++++ .../{invalid.bpmn => invalid-task.bpmn} | 0 test/rules/no-implicit-split.mjs | 7 ++++ .../invalid-callActivity.bpmn | 42 +++++++++++++++++++ 7 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 test/rules/fake-join/invalid-callActivity.bpmn rename test/rules/fake-join/{invalid.bpmn => invalid-task.bpmn} (100%) create mode 100644 test/rules/no-implicit-split/invalid-callActivity.bpmn diff --git a/rules/fake-join.js b/rules/fake-join.js index 9e8a980..2410454 100644 --- a/rules/fake-join.js +++ b/rules/fake-join.js @@ -14,7 +14,7 @@ module.exports = function() { function check(node, reporter) { if (!isAny(node, [ - 'bpmn:Task', + 'bpmn:Activity', 'bpmn:Event' ])) { return; diff --git a/rules/no-implicit-split.js b/rules/no-implicit-split.js index 48672cd..8780f55 100644 --- a/rules/no-implicit-split.js +++ b/rules/no-implicit-split.js @@ -15,7 +15,7 @@ module.exports = function() { function check(node, reporter) { if (!isAny(node, [ - 'bpmn:Task', + 'bpmn:Activity', 'bpmn:Event' ])) { return; diff --git a/test/rules/fake-join.mjs b/test/rules/fake-join.mjs index b9831dc..031796f 100644 --- a/test/rules/fake-join.mjs +++ b/test/rules/fake-join.mjs @@ -24,7 +24,14 @@ RuleTester.verify('fake-join', rule, { ], invalid: [ { - moddleElement: readModdle(__dirname + '/fake-join/invalid.bpmn'), + moddleElement: readModdle(__dirname + '/fake-join/invalid-task.bpmn'), + report: { + id: 'Element', + message: 'Incoming flows do not join' + } + }, + { + moddleElement: readModdle(__dirname + '/fake-join/invalid-callActivity.bpmn'), report: { id: 'Element', message: 'Incoming flows do not join' diff --git a/test/rules/fake-join/invalid-callActivity.bpmn b/test/rules/fake-join/invalid-callActivity.bpmn new file mode 100644 index 0000000..56aecfa --- /dev/null +++ b/test/rules/fake-join/invalid-callActivity.bpmn @@ -0,0 +1,42 @@ + + + + + SequenceFlow_1uh5qzh + + + + SequenceFlow_1mrgwdi + + + + SequenceFlow_1uh5qzh + SequenceFlow_1mrgwdi + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/rules/fake-join/invalid.bpmn b/test/rules/fake-join/invalid-task.bpmn similarity index 100% rename from test/rules/fake-join/invalid.bpmn rename to test/rules/fake-join/invalid-task.bpmn diff --git a/test/rules/no-implicit-split.mjs b/test/rules/no-implicit-split.mjs index 26d6a50..0045e12 100644 --- a/test/rules/no-implicit-split.mjs +++ b/test/rules/no-implicit-split.mjs @@ -36,6 +36,13 @@ RuleTester.verify('no-implicit-split', rule, { id: 'Element', message: 'Flow splits implicitly' } + }, + { + moddleElement: readModdle(__dirname + '/no-implicit-split/invalid-callActivity.bpmn'), + report: { + id: 'Element', + message: 'Flow splits implicitly' + } } ] }); \ No newline at end of file diff --git a/test/rules/no-implicit-split/invalid-callActivity.bpmn b/test/rules/no-implicit-split/invalid-callActivity.bpmn new file mode 100644 index 0000000..53a09f1 --- /dev/null +++ b/test/rules/no-implicit-split/invalid-callActivity.bpmn @@ -0,0 +1,42 @@ + + + + + Flow_2 + + + Flow_1 + + + + + Flow_1 + Flow_2 + + + + + + + + + + + + + + + + + + + + + + + + + + + +