From 14e30e47414e5b65ac0ed025223e0918f9b64d39 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 20 Feb 2017 14:57:17 +0100 Subject: [PATCH] BpNode: set missing to unknown before fetching... ...sorting state refs #105 --- library/Businessprocess/BpNode.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/Businessprocess/BpNode.php b/library/Businessprocess/BpNode.php index 61888c0..32a88a0 100644 --- a/library/Businessprocess/BpNode.php +++ b/library/Businessprocess/BpNode.php @@ -326,19 +326,19 @@ class BpNode extends Node if (!$this->hasChildren()) { // TODO: delegate this to operators, should mostly fail - $this->state = 3; + $this->setState(self::ICINGA_UNKNOWN); $this->setMissing(); return $this; } foreach ($this->getChildren() as $child) { $bp->beginLoopDetection($this->name); - $sort_states[] = $child->getSortingState(); - $lastStateChange = max($lastStateChange, $child->getLastStateChange()); - $bp->endLoopDetection($this->name); if ($child instanceof MonitoredNode && $child->isMissing()) { $child->setState(self::ICINGA_UNKNOWN); } + $sort_states[] = $child->getSortingState(); + $lastStateChange = max($lastStateChange, $child->getLastStateChange()); + $bp->endLoopDetection($this->name); } $this->setLastStateChange($lastStateChange);