/** * Create the scenario name for the current transition. Scenario name has following format : <br/> * <pre> [currentStatus]_[nextStatus]</pre> * * @param CModel $model the model being validated * @param string $nxtStatus the next status name (destination status for the model) * @return string SW scenario name for this transition * */ private function _getSWScenarioName($model, $nxtStatus) { $swScenario = null; $nextNode = $model->swCreateNode($nxtStatus); $curNode = $model->swGetStatus(); if (!is_null($curNode)) { $swScenario = $curNode->getId() . SWValidator::SW_SCENARIO_STATUS_SEPARATOR; if ($curNode->getWorkflowId() != $nextNode->getWorkflowId()) { $swScenario .= $nextNode->toString(); } else { $swScenario .= $nextNode->getId(); } } else { $swScenario = '_' . $nextNode->toString(); } return $swScenario; }