mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-02-17 09:52:59 -05:00
BpConfig: Flag imported configurations
This commit is contained in:
parent
431a5e0085
commit
42642c88d6
1 changed files with 19 additions and 1 deletions
|
|
@ -3,7 +3,6 @@
|
|||
namespace Icinga\Module\Businessprocess;
|
||||
|
||||
use Exception;
|
||||
use LogicException;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Exception\IcingaException;
|
||||
use Icinga\Exception\NotFoundError;
|
||||
|
|
@ -89,6 +88,13 @@ class BpConfig
|
|||
*/
|
||||
protected $root_nodes = array();
|
||||
|
||||
/**
|
||||
* Whether this configuration has been imported
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $imported = false;
|
||||
|
||||
/**
|
||||
* Imported nodes
|
||||
*
|
||||
|
|
@ -552,6 +558,17 @@ class BpConfig
|
|||
return $missing;
|
||||
}
|
||||
|
||||
public function setImported($state = true)
|
||||
{
|
||||
$this->imported = (bool) $state;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isImported()
|
||||
{
|
||||
return $this->imported;
|
||||
}
|
||||
|
||||
public function createImportedNode($config, $name = null)
|
||||
{
|
||||
$params = (object) array('configName' => $config);
|
||||
|
|
@ -569,6 +586,7 @@ class BpConfig
|
|||
{
|
||||
if (! isset($this->importedConfigs[$name])) {
|
||||
$import = $this->storage()->loadProcess($name);
|
||||
$import->setImported();
|
||||
|
||||
if ($this->usesSoftStates()) {
|
||||
$import->useSoftStates();
|
||||
|
|
|
|||
Loading…
Reference in a new issue