/** * Add a new condition. * * @param GraphBase $graph The graphing object * @param ConditionInterface $condition The condition to visualize * @param int $index The transition index * * @return Vertex */ public function addCondition(GraphBase $graph, ConditionInterface $condition, $index) { $node = $graph->createVertex("[" . $index . "] " . $condition->getName()); $node->setLayoutAttribute('shape', 'box'); $node->setLayoutAttribute('style', 'rounded,dashed'); $node->setLayoutAttribute('fontname', 'Arial'); $node->setLayoutAttribute('fontsize', '12'); $node->setLayoutAttribute('fontcolor', '#111111'); return $node; }
/** * {@inheritdoc} */ public function process() { $process = $this->condition ? $this->condition->check() : true; return $process ? $this->getTransitionTo()->process() : false; }