diff --git a/library/Businessprocess/BpNode.php b/library/Businessprocess/BpNode.php index 7776f34..7f1c5d0 100644 --- a/library/Businessprocess/BpNode.php +++ b/library/Businessprocess/BpNode.php @@ -428,6 +428,22 @@ class BpNode extends Node return $this->children; } + /** + * return BpNode[] + */ + public function getChildBpNodes() + { + $children = array(); + + foreach ($this->getChildren() as $name => $child) { + if ($child instanceof BpNode) { + $children[$name] = $child; + } + } + + return $children; + } + protected function assertNumericOperator() { if (! is_numeric($this->operator)) { @@ -435,62 +451,6 @@ class BpNode extends Node } } - public function toLegacyConfigString(& $rendered = array()) - { - $cfg = ''; - if (array_key_exists($this->name, $rendered)) { - return $cfg; - } - $rendered[$this->name] = true; - $children = array(); - - foreach ($this->getChildren() as $name => $child) { - $children[] = (string) $child; - if (array_key_exists($name, $rendered)) { - continue; - } - - if ($child instanceof BpNode) { - $cfg .= $child->toLegacyConfigString($rendered) . "\n"; - } - } - $eq = '='; - $op = $this->operator; - if (is_numeric($op)) { - $eq = '= ' . $op . ' of:'; - $op = '+'; - } - - $strChildren = implode(' ' . $op . ' ', $children); - if ((count($children) < 2) && $op !== '&') { - $strChildren = $op . ' ' . $strChildren; - } - $cfg .= sprintf( - "%s %s %s\n", - $this->name, - $eq, - $strChildren - ); - if ($this->hasAlias() || $this->getDisplay() > 0) { - $prio = $this->getDisplay(); - $cfg .= sprintf( - "display %s;%s;%s\n", - $prio, - $this->name, - $this->getAlias() - ); - } - if ($this->hasInfoUrl()) { - $cfg .= sprintf( - "info_url;%s;%s\n", - $this->name, - $this->getInfoUrl() - ); - } - - return $cfg; - } - public function operatorHtml() { switch ($this->operator) {