protected function _setupFlow(__IFlowState &$flow_state, __ConfigurationSection &$section) { $subsections = $section->getSections(); foreach ($subsections as $flow_section) { switch (strtoupper($flow_section->getName())) { case 'TRANSITION': $transition = $this->_parseTransitionNode($flow_section); $flow_state->addTransition($transition); break; case 'SET': $attribute = $this->_parseAttribute($flow_section); $flow_state->addAttribute($attribute); break; case 'IF': $transition = $this->_parseIfNode($flow_section); $flow_state->addTransition($transition); break; case 'IF-PERMISSION': $transition = $this->_parseIfPermissionNode($flow_section); $flow_state->addTransition($transition); break; default: throw new __ConfigurationException('Unexpected tag ' . $flow_section->getName() . ' as child of ' . $section->getName()); break; } } return $flow_state; }
public function addState(__IFlowState &$state) { $this->_states[$state->getId()] =& $state; if ($state instanceof __StartFlowState) { if ($this->_start_state == null) { $this->_start_state =& $state; } else { throw __ExceptionFactory::getInstance()->createException('Multiple start states in flow ' . $this->_id); } } }