From c2e02796faf25750d732854b74ab6ccc62693890 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sat, 7 Feb 2015 00:36:01 +0100 Subject: [PATCH] Businessprocess\Controller: optional state types Only set state type if given, default is set at process load time --- library/Businessprocess/Controller.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/library/Businessprocess/Controller.php b/library/Businessprocess/Controller.php index 9129856..0a47d5b 100644 --- a/library/Businessprocess/Controller.php +++ b/library/Businessprocess/Controller.php @@ -63,14 +63,19 @@ class Controller extends ModuleActionController $bp = $storage->loadProcess($process); - if ($this->_getParam('state_type') === 'soft' - || (isset($bpconf->states) && $bpconf->states === 'soft')) { - $bp->useSoftStates(); + if (null !== ($stateType = $this->params->get('state_type'))) { + if ($stateType === 'soft') { + $bp->useSoftStates(); + } + if ($stateType === 'soft') { + $bp->useHardStates(); + } } + $bp->retrieveStatesFromBackend($this->backend); return $bp; - } + protected function loadSlas() { $bpconf = $this->bpconf;