Пример #1
0
 /**
  * @param mixed $context
  * @return bool
  */
 protected function isAllowed($context)
 {
     if (!$this->condition) {
         return true;
     }
     return $this->condition->evaluate($context) ? true : false;
 }
Пример #2
0
 /**
  * Check is transition pre condition is allowed for current workflow item.
  *
  * @param WorkflowItem $workflowItem
  * @param Collection|null $errors
  * @return boolean
  */
 protected function isPreConditionAllowed(WorkflowItem $workflowItem, Collection $errors = null)
 {
     if (!$this->preCondition) {
         return true;
     }
     return $this->preCondition->evaluate($workflowItem, $errors) ? true : false;
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 protected function isConditionAllowed($context)
 {
     return !$this->operand->evaluate($context, $this->errors);
 }
 /**
  * @param ExpressionInterface   $expr
  * @param ContextInterface      $context
  * @param DataAccessorInterface $data
  * @param bool                  $evaluate
  * @param string                $encoding
  *
  * @return mixed|string
  */
 protected function processExpression(ExpressionInterface $expr, ContextInterface $context, DataAccessorInterface $data, $evaluate, $encoding)
 {
     return $evaluate ? $expr->evaluate(['context' => $context, 'data' => $data]) : $this->encoderRegistry->getEncoder($encoding)->encodeExpr($expr);
 }