Symfony\Component\Workflow\Dumper\GraphvizDumper::dump PHP Method

dump() public method

Dumps the workflow as a graphviz graph. Available options: * graph: The default options for the whole graph * node: The default options for nodes (places + transitions) * edge: The default options for edges
public dump ( Symfony\Component\Workflow\Definition $definition, Symfony\Component\Workflow\Marking $marking = null, array $options = [] )
$definition Symfony\Component\Workflow\Definition
$marking Symfony\Component\Workflow\Marking
$options array
    public function dump(Definition $definition, Marking $marking = null, array $options = array())
    {
        $places = $this->findPlaces($definition, $marking);
        $transitions = $this->findTransitions($definition);
        $edges = $this->findEdges($definition);
        $options = array_replace_recursive(self::$defaultOptions, $options);
        return $this->startDot($options) . $this->addPlaces($places) . $this->addTransitions($transitions) . $this->addEdges($edges) . $this->endDot();
    }

Usage Example

コード例 #1
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $workflow = $this->getContainer()->get('workflow.' . $input->getArgument('name'));
     $definition = $this->getProperty($workflow, 'definition');
     $dumper = new GraphvizDumper();
     $marking = new Marking();
     foreach ($input->getArgument('marking') as $place) {
         $marking->mark($place);
     }
     $output->writeln($dumper->dump($definition, $marking));
 }
All Usage Examples Of Symfony\Component\Workflow\Dumper\GraphvizDumper::dump