From 19ab1a28ccdd84f9b3ec351c22d97cfea29ac60c Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 3 Mar 2015 11:00:15 +0100 Subject: [PATCH] BpNode: show full process missing if childs are so --- library/Businessprocess/BpNode.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/library/Businessprocess/BpNode.php b/library/Businessprocess/BpNode.php index 8b05d12..0aeb0de 100644 --- a/library/Businessprocess/BpNode.php +++ b/library/Businessprocess/BpNode.php @@ -16,6 +16,7 @@ class BpNode extends Node protected $child_names = array(); protected $alias; protected $counters; + protected $missing = null; public function __construct( BusinessProcess $bp, @@ -52,6 +53,20 @@ class BpNode extends Node return $this->counters; } + public function isMissing() + { + if ($this->missing === null) { + $exists = false; + foreach ($this->getChildren() as $child) { + if (! $child->isMissing()) { + $exists = true; + } + } + $this->missing = ! $exists; + } + return $this->missing; + } + public function getOperator() { return $this->operator;