Outils pour utilisateurs

Outils du site


pele_mele:stack_exchange:stack_overflow:50909507

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
pele_mele:stack_exchange:stack_overflow:50909507 [2024/11/23 04:02] – supprimée - modification externe (Date inconnue) 127.0.0.1pele_mele:stack_exchange:stack_overflow:50909507 [2024/11/23 04:02] (Version actuelle) – ↷ Nom de la page changé de pele_mele:stack_exchange:stack_overflow:stackoverflow-50909507 à pele_mele:stack_exchange:stack_overflow:50909507 alexis
Ligne 1: Ligne 1:
 +====== List available workflows in Symfony ======
 +
 +I am using symfony workflow component in a symfony 3 project. I would like to list all available workflows.
 +
 +Is there a way to find that list? I was looking in the component code base but didn't find anything I could start working on.
 +
 +<WRAP help>
 +Just make a debug with search term.
 +
 +<code>
 +debug:container --show-private workflow
 +</code>
 +
 +this would be the result:
 +
 +<code>
 +Select one of the following services to display its information:
 +  [0] console.command.workflow_dump
 +  [1] workflow.abstract
 +  [2] workflow.marking_store.multiple_state
 +  [3] workflow.marking_store.single_state
 +  [4] workflow.registry
 +  [5] workflow.security.expression_language
 +  [6] workflow.blog_publishing
 +  [7] workflow.blog_publishing.definition
 +  [8] workflow.twig_extension
 +  [9] Symfony\Component\Workflow\Registry
 +</code>
 +
 +The above is a simple and a not usable result for your bussiness logic.
 +
 +If your intention is to do "something" with the output, take a look at the ''Symfony\Bundle\FrameworkBundle\Command\ContainerDebugCommand'' and try to extend the command and implement your own logic.
 +
 +If you extend(which I recommend) the Command you will have access to the ''getContainerBuilder'' function which gets you the builder container and then you can do ''$builder->getServiceIds()'' and start a string search inside a loop returning all the matched services and that would be your workflow list.
 +
 +Hope it helps!
 +</WRAP>
 +<WRAP info>
 +[[https://stackoverflow.com/questions/50909507/list-available-workflows-in-symfony|List available workflows in Symfony - Stack Overflow]]
 +</WRAP>