Пример #1
0
 /**
  * Propagates the new state machine position to the execution context of the given subject,
  * by calling the execution context's "onStateEntry" method.
  *
  * @param StatefulSubjectInterface $subject
  */
 public function onEntry(StatefulSubjectInterface $subject)
 {
     parent::onEntry($subject);
     foreach ($this->getOption(self::OPTION_VARS, []) as $key => $value) {
         $subject->getExecutionContext()->setParameter($key, $value);
     }
 }
 public function onEntry(StatefulSubjectInterface $process_state)
 {
     if (!$process_state instanceof ProcessStateInterface) {
         throw new RuntimeError('Only ' . ProcessStateInterface::CLASS . ' subjects supported by ' . static::CLASS);
     }
     parent::onEntry($process_state);
     $commands = $this->createCommands($process_state);
     $execution_context = $process_state->getExecutionContext();
     $execution_context->setParameter('commands', new CommandList($commands));
 }