/** * Transit workflow item. * * @param WorkflowItem $workflowItem * @param string|Transition $transition * @throws ForbiddenTransitionException * @throws InvalidTransitionException */ public function transit(WorkflowItem $workflowItem, $transition) { $transition = $this->transitionManager->extractTransition($transition); $this->checkTransitionValid($transition, $workflowItem, true); $transitionRecord = $this->createTransitionRecord($workflowItem, $transition); $transition->transit($workflowItem); $workflowItem->addTransitionRecord($transitionRecord); $entity = $workflowItem->getEntity(); $this->entityConnector->setWorkflowItem($entity, $workflowItem); $this->entityConnector->setWorkflowStep($entity, $workflowItem->getCurrentStep()); $this->aclManager->updateAclIdentities($workflowItem); }
/** * @expectedException \Oro\Bundle\WorkflowBundle\Exception\WorkflowException * @expectedExceptionMessage Can't set property "workflowStep" to entity */ public function testSetWorkflowStepException() { $this->entityConnector->setWorkflowStep(new \DateTime(), new WorkflowStep()); }