diff --git a/library/Businessprocess/BpNode.php b/library/Businessprocess/BpNode.php index ab76e3e7..7ac40733 100644 --- a/library/Businessprocess/BpNode.php +++ b/library/Businessprocess/BpNode.php @@ -99,13 +99,16 @@ public function getStateSummary() return $this->counters; } - public function hasProblems() + public function hasProblems(bool $ignoreHandledStates = false) { - if ($this->isProblem()) { + if ($this->isProblem() && ($ignoreHandledStates || ! $this->isHandled())) { return true; } - $okStates = array('OK', 'UP', 'PENDING', 'MISSING'); + $okStates = ['OK', 'UP', 'PENDING', 'MISSING']; + if (! $ignoreHandledStates) { + array_push($okStates, 'CRITICAL-HANDLED', 'WARNING-HANDLED', 'UNKNOWN-HANDLED'); + } foreach ($this->getStateSummary() as $state => $cnt) { if ($cnt !== 0 && ! in_array($state, $okStates)) { @@ -149,7 +152,7 @@ public function getProblematicChildren() if (isset($this->stateOverrides[$child->getName()])) { $problem = $this->getChildState($child) > 0; } else { - $problem = $child->isProblem() || ($child instanceof BpNode && $child->hasProblems()); + $problem = $child->isProblem() || ($child instanceof BpNode && $child->hasProblems(true)); } if ($problem) { diff --git a/library/Businessprocess/Web/Component/BpDashboardTile.php b/library/Businessprocess/Web/Component/BpDashboardTile.php index 9a4a0f64..6a1e9884 100644 --- a/library/Businessprocess/Web/Component/BpDashboardTile.php +++ b/library/Businessprocess/Web/Component/BpDashboardTile.php @@ -30,6 +30,9 @@ public function __construct(BpConfig $bp, $title, $description, $icon, $url, $ur foreach ($bp->getChildren() as $node) { $state = strtolower($node->getStateName()); + if ($node->isHandled()) { + $state .= ' handled'; + } $tiles->add(Html::tag( 'a',