dump() публичный Метод

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
Пример #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));
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $container = $this->getContainer();
     $serviceId = $input->getArgument('name');
     if ($container->has('workflow.' . $serviceId)) {
         $workflow = $container->get('workflow.' . $serviceId);
     } elseif ($container->has('state_machine.' . $serviceId)) {
         $workflow = $container->get('state_machine.' . $serviceId);
     } else {
         throw new \InvalidArgumentException(sprintf('No service found for "workflow.%1$s" nor "state_machine.%1$s".', $serviceId));
     }
     $dumper = new GraphvizDumper();
     $marking = new Marking();
     foreach ($input->getArgument('marking') as $place) {
         $marking->mark($place);
     }
     $output->writeln($dumper->dump($workflow->getDefinition(), $marking));
 }