mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-21 11:42:53 -05:00
BpNode: use modified loop detection everywhere
This commit is contained in:
parent
b954a67c79
commit
857913172b
2 changed files with 8 additions and 2 deletions
|
|
@ -299,18 +299,23 @@ class BpNode extends Node
|
|||
*/
|
||||
public function reCalculateState()
|
||||
{
|
||||
$bp = $this->bp;
|
||||
|
||||
$sort_states = array();
|
||||
$lastStateChange = 0;
|
||||
|
||||
if (!$this->hasChildren()) {
|
||||
// TODO: delegate this to operators, should mostly fail
|
||||
$this->state = 0;
|
||||
$this->setMissing();
|
||||
return $this;
|
||||
}
|
||||
|
||||
foreach ($this->getChildren() as $child) {
|
||||
$this->beginLoopDetection();
|
||||
$bp->beginLoopDetection($this->name);
|
||||
$sort_states[] = $child->getSortingState();
|
||||
$lastStateChange = max($lastStateChange, $child->getLastStateChange());
|
||||
$this->endLoopDetection();
|
||||
$bp->endLoopDetection($this->name);
|
||||
}
|
||||
|
||||
$this->setLastStateChange($lastStateChange);
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ class BusinessProcess
|
|||
|
||||
protected $simulationCount = 0;
|
||||
|
||||
/** @var ProcessChanges */
|
||||
protected $appliedChanges;
|
||||
|
||||
public function __construct()
|
||||
|
|
|
|||
Loading…
Reference in a new issue