@@ -79,13 +79,27 @@ protected function configure()
79
79
*/
80
80
protected function execute (InputInterface $ input , OutputInterface $ output ): int
81
81
{
82
- $ workflowId = $ input ->getArgument ('name ' );
82
+ $ workflowName = $ input ->getArgument ('name ' );
83
83
84
- if (!\in_array ($ workflowId , array_keys ($ this ->workflows ), true )) {
85
- throw new InvalidArgumentException (sprintf ('No service found for "workflow.%1$s" nor "state_machine.%1$s". ' , $ workflowId ));
84
+ $ workflow = null ;
85
+
86
+ $ workflowId = 'workflow. ' . $ workflowName ;
87
+ if (\in_array ($ workflowId , array_keys ($ this ->workflows ), true )) {
88
+ $ workflow = $ this ->workflows [$ workflowId ];
89
+ $ type = 'workflow ' ;
86
90
}
87
91
88
- $ type = explode ('. ' , $ workflowId )[0 ];
92
+ if (!$ workflow ) {
93
+ $ workflowId = 'state_machine. ' . $ workflowName ;
94
+ if (\in_array ($ workflowId , array_keys ($ this ->workflows ), true )) {
95
+ $ workflow = $ this ->workflows [$ workflowId ];
96
+ $ type = 'state_machine ' ;
97
+ }
98
+ }
99
+
100
+ if (null === $ workflow ) {
101
+ throw new InvalidArgumentException (sprintf ('No service found for "workflow.%1$s" nor "state_machine.%1$s". ' , $ workflowName ));
102
+ }
89
103
90
104
switch ($ input ->getOption ('dump-format ' )) {
91
105
case 'puml ' :
@@ -109,8 +123,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
109
123
$ marking ->mark ($ place );
110
124
}
111
125
112
- $ workflow = $ this ->workflows [$ workflowId ];
113
-
114
126
$ options = [
115
127
'name ' => $ workflowId ,
116
128
'nofooter ' => true ,
0 commit comments