From 6cc5eb8e74bb34bc5f74fe23dba369ccfd22a9c5 Mon Sep 17 00:00:00 2001 From: Ravi Kumar Kempapura Srinivasa Date: Tue, 3 Mar 2020 16:46:48 +0100 Subject: [PATCH] Check recursively for Empty BpNodes In BpNode::recalculateState() the BpNode needs to be recursively checked if its children is empty using BpNode::isEmpty() instead of BpNode::hasChildren(). --- library/Businessprocess/BpNode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Businessprocess/BpNode.php b/library/Businessprocess/BpNode.php index b6e29d4..9aeaab8 100644 --- a/library/Businessprocess/BpNode.php +++ b/library/Businessprocess/BpNode.php @@ -374,7 +374,7 @@ class BpNode extends Node $sort_states = array(); $lastStateChange = 0; - if (!$this->hasChildren()) { + if ($this->isEmpty()) { // TODO: delegate this to operators, should mostly fail $this->setState(self::NODE_EMPTY); return $this;