/** * @param \Spryker\Zed\Oms\Business\Process\EventInterface $event * * @return void */ public function setEvent(EventInterface $event) { $nameEvent = $event->getName(); if ($event->isOnEnter()) { $nameEvent .= ' (on enter)'; } foreach ($this->logEntities as $logEntity) { $logEntity->setEvent($nameEvent); } }
/** * @param \DateTime $currentTime * @param \Spryker\Zed\Oms\Business\Process\EventInterface $event * * @return \DateTime */ protected function calculateTimeoutDateFromEvent(DateTime $currentTime, EventInterface $event) { $currentTime = clone $currentTime; if (!isset($this->eventToTimeoutBuffer[$event->getName()])) { $timeout = $event->getTimeout(); $interval = DateInterval::createFromDateString($timeout); $this->validateTimeout($interval, $timeout); $this->eventToTimeoutBuffer[$event->getName()] = $currentTime->add($interval); Log::log($this->eventToTimeoutBuffer, 'timeout.log'); } return $this->eventToTimeoutBuffer[$event->getName()]; }
/** * @param \Spryker\Zed\Oms\Business\Process\EventInterface $event * * @return \Spryker\Zed\Oms\Business\Process\TransitionInterface[] */ public function getOutgoingTransitionsByEvent(EventInterface $event) { $transitions = []; foreach ($this->outgoingTransitions as $transition) { if ($transition->hasEvent()) { if ($transition->getEvent()->getName() === $event->getName()) { $transitions[] = $transition; } } } return $transitions; }