示例#1
0
文件: Graph.php 项目: arcturial/fsm
 /**
  * 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;
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function process()
 {
     $process = $this->condition ? $this->condition->check() : true;
     return $process ? $this->getTransitionTo()->process() : false;
 }