Revert "Node: Aggregate parents if none are registered yet"

This reverts commit d1f32c59f1.
This commit is contained in:
Johannes Meyer 2019-02-21 08:09:58 +01:00
parent 2799eff860
commit e0529ee844
2 changed files with 13 additions and 13 deletions

View file

@ -25,6 +25,15 @@ class NodeController extends Controller
foreach ($this->storage()->listProcessNames() as $configName) {
$config = $this->storage()->loadProcess($configName);
// TODO: Fix issues with children, they do not exist unless resolved :-/
// This is a workaround:
foreach ($config->getRootNodes() as $node) {
$node->getState();
}
foreach ($config->getRootNodes() as $node) {
$node->clearState();
}
if (! $config->hasNode($name)) {
continue;
}

View file

@ -50,7 +50,7 @@ abstract class Node
*
* @var array
*/
protected $parents;
protected $parents = array();
/**
* Node identifier
@ -304,7 +304,7 @@ abstract class Node
public function hasParents()
{
return count($this->getParents()) > 0;
return count($this->parents) > 0;
}
public function hasParentName($name)
@ -321,7 +321,7 @@ abstract class Node
public function removeParent($name)
{
$this->parents = array_filter(
$this->getParents(),
$this->parents,
function (BpNode $parent) use ($name) {
return $parent->getName() !== $name;
}
@ -335,15 +335,6 @@ abstract class Node
*/
public function getParents()
{
if ($this->parents === null) {
$this->parents = [];
foreach ($this->bp->getBpNodes() as $name => $node) {
if ($node->hasChild($this->getName())) {
$this->parents[] = $node;
}
}
}
return $this->parents;
}
@ -357,7 +348,7 @@ abstract class Node
}
$paths = array();
foreach ($this->getParents() as $parent) {
foreach ($this->parents as $parent) {
foreach ($parent->getPaths() as $path) {
$path[] = $this->getName();
$paths[] = $path;