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;