mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-30 15:19:25 -05:00
parent
302a041b30
commit
908dbd905f
1 changed files with 23 additions and 3 deletions
|
|
@ -51,7 +51,7 @@ class BpConfig
|
|||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $state_type = self::HARD_STATE;
|
||||
protected $state_type;
|
||||
|
||||
/**
|
||||
* Warnings, usually filled at process build time
|
||||
|
|
@ -305,6 +305,26 @@ class BpConfig
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getStateType()
|
||||
{
|
||||
if ($this->state_type === null) {
|
||||
if ($this->getMetadata()->has('Statetype')) {
|
||||
switch ($this->getMetadata()->get('Statetype')) {
|
||||
case 'hard':
|
||||
$this->state_type = self::HARD_STATE;
|
||||
break;
|
||||
case 'soft':
|
||||
$this->state_type = self::SOFT_STATE;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$this->state_type = self::HARD_STATE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->state_type;
|
||||
}
|
||||
|
||||
public function useSoftStates()
|
||||
{
|
||||
$this->state_type = self::SOFT_STATE;
|
||||
|
|
@ -319,12 +339,12 @@ class BpConfig
|
|||
|
||||
public function usesSoftStates()
|
||||
{
|
||||
return $this->state_type === self::SOFT_STATE;
|
||||
return $this->getStateType() === self::SOFT_STATE;
|
||||
}
|
||||
|
||||
public function usesHardStates()
|
||||
{
|
||||
return $this->state_type === self::HARD_STATE;
|
||||
return $this->getStateType() === self::HARD_STATE;
|
||||
}
|
||||
|
||||
public function addRootNode($name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue