mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-30 18:39:33 -05:00
parent
a9db4f9120
commit
2f3e5fb419
2 changed files with 25 additions and 19 deletions
|
|
@ -483,6 +483,11 @@ class BpConfig
|
|||
*/
|
||||
public function getNode($name)
|
||||
{
|
||||
if ($name === '__unbound__') {
|
||||
return $this->getUnboundBaseNode();
|
||||
|
||||
}
|
||||
|
||||
if (array_key_exists($name, $this->nodes)) {
|
||||
return $this->nodes[$name];
|
||||
}
|
||||
|
|
@ -506,6 +511,25 @@ class BpConfig
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BpNode
|
||||
*/
|
||||
public function getUnboundBaseNode()
|
||||
{
|
||||
// Hint: state is useless here, but triggers parent/child "calculation"
|
||||
// This is an ugly workaround and should be made obsolete
|
||||
$this->calculateAllStates();
|
||||
|
||||
$names = array_keys($this->getUnboundNodes());
|
||||
$bp = new BpNode($this, (object) array(
|
||||
'name' => '__unbound__',
|
||||
'operator' => '&',
|
||||
'child_names' => $names
|
||||
));
|
||||
$bp->setAlias($this->translate('Unbound nodes'));
|
||||
return $bp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @return BpNode
|
||||
|
|
|
|||
|
|
@ -309,25 +309,7 @@ abstract class Renderer extends Html
|
|||
|
||||
protected function createUnboundParent(BpConfig $bp)
|
||||
{
|
||||
// Hint: state is useless here, but triggers parent/child "calculation"
|
||||
// This is an ugly workaround and should be made obsolete
|
||||
foreach ($bp->getBpNodes() as $p) {
|
||||
$p->getState();
|
||||
}
|
||||
$unbound = $bp->getUnboundNodes();
|
||||
|
||||
$parent = new BpNode($bp, (object) array(
|
||||
'name' => '__unbound__',
|
||||
'operator' => '|',
|
||||
'child_names' => array_keys($unbound)
|
||||
));
|
||||
$parent->getState();
|
||||
$parent->setMissing()
|
||||
->setDowntime(false)
|
||||
->setAck(false)
|
||||
->setAlias('Unbound nodes');
|
||||
|
||||
return $parent;
|
||||
return $bp->getNode('__unbound__');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue