From fe5181052f3999ee1f83a606e10a177abbce7c93 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 10 Nov 2015 21:11:20 +0100 Subject: [PATCH] BusinessProcess: new method listBpNodes() --- library/Businessprocess/BusinessProcess.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/library/Businessprocess/BusinessProcess.php b/library/Businessprocess/BusinessProcess.php index 13a0e16..1789415 100644 --- a/library/Businessprocess/BusinessProcess.php +++ b/library/Businessprocess/BusinessProcess.php @@ -523,6 +523,24 @@ class BusinessProcess return $this; } + public function listBpNodes() + { + $nodes = array(); + + foreach ($this->nodes as $node) { + if (! $node instanceof BpNode) { + continue; + } + + $name = (string) $node; + $alias = $node->getAlias(); + $nodes[$name] = $name === $alias ? $name : sprintf('%s (%s)', $alias, $node); + } + + natsort($nodes); + return $nodes; + } + public function getUnboundNodes() { $nodes = array();