From ff75233f0568f3b0d705030c3622a7a3c2d7612e Mon Sep 17 00:00:00 2001 From: Abdul Ahad Date: Thu, 29 Aug 2024 15:37:01 +0200 Subject: [PATCH] fix: no outgoing from task --- lib/handler/attachersHandler.js | 2 +- test/fixtures/no-outgoing-from-task.bpmn | 55 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/no-outgoing-from-task.bpmn diff --git a/lib/handler/attachersHandler.js b/lib/handler/attachersHandler.js index 12b2548..6e32c8b 100644 --- a/lib/handler/attachersHandler.js +++ b/lib/handler/attachersHandler.js @@ -12,7 +12,7 @@ export default { const nextElements = []; const attachedOutgoing = (element.attachers || []) - .map(att => att.outgoing.reverse()) + .map(att => (att.outgoing ? att.outgoing.reverse() : [])) .flat() .map(out => out.targetRef); diff --git a/test/fixtures/no-outgoing-from-task.bpmn b/test/fixtures/no-outgoing-from-task.bpmn new file mode 100644 index 0000000..60cb4e8 --- /dev/null +++ b/test/fixtures/no-outgoing-from-task.bpmn @@ -0,0 +1,55 @@ + + + + + Flow_1 + + + + Flow_1 + Flow_2 + + + + Flow_2 + Flow_6 + + Flow_3 + + + + Flow_3 + Flow_4 + + + + + Flow_4 + Flow_5 + + + + + + + + + Flow_6 + Flow_7 + Flow_8 + + + + + Flow_7 + Flow_9 + + + + Flow_9 + + + Flow_8 + + + \ No newline at end of file