public function fetchFiles() { $files = array(); $storage = new LegacyStorage(Config::module('businessprocess')->getSection('global')); foreach ($storage->listProcesses() as $name => $title) { $files['processes/' . $name . '.bp'] = $storage->getSource($name); } return $files; }
protected function importedNode() { if ($this->importedNode === null) { $storage = new LegacyStorage(Config::module('businessprocess')->getSection('global')); try { $this->importedBp = $storage->loadProcess($this->configName); if ($this->bp->usesSoftStates()) { $this->importedBp->useSoftStates(); } else { $this->importedBp->useHardStates(); } $this->importedBp->retrieveStatesFromBackend(); $this->importedNode = $this->importedBp->getNode($this->name); } catch (Exception $e) { $node = new BpNode($this->bp, (object) array('name' => $this->name, 'operator' => '&', 'child_names' => array())); $node->setState(2); $node->setMissing(false)->setDowntime(false)->setAck(false)->setAlias($e->getMessage()); $this->importedNode = $node; } } return $this->importedNode; }