You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -438,7 +439,7 @@ public function getWarnings(): array;
438
439
// get the exception which caused the workflow to fail
439
440
public function getException(): ?Exception;
440
441
// get the debug execution log of the workflow
441
-
public function debug(): string;
442
+
public function debug(?OutputFormat $formatter = null);
442
443
// access the container which was used for the workflow
443
444
public function getContainer(): WorkflowContainer;
444
445
// get the last executed step
@@ -455,7 +456,7 @@ The **debug** method provides an execution log including all processed steps wit
455
456
456
457
Some example outputs for our example workflow may look like the following.
457
458
458
-
### Successful execution
459
+
####Successful execution
459
460
460
461
```
461
462
Process log for workflow 'AddSongToPlaylist':
@@ -481,7 +482,7 @@ Summary:
481
482
482
483
Note the additional data added to the debug log for the **Process** stage and the **NotifySubscribers** step via the **attachStepInfo** method of the **WorkflowControl**.
483
484
484
-
### Failed workflow
485
+
####Failed workflow
485
486
486
487
```
487
488
Process log for workflow 'AddSongToPlaylist':
@@ -495,7 +496,7 @@ Summary:
495
496
496
497
In this example the **CurrentUserIsAllowedToEditPlaylistValidator** step threw an exception with the message `playlist locked`.
497
498
498
-
### Workflow skipped
499
+
####Workflow skipped
499
500
500
501
```
501
502
Process log for workflow 'AddSongToPlaylist':
@@ -513,6 +514,18 @@ Summary:
513
514
In this example the **AcceptOpenSuggestionForSong** step found a matching open suggestion and successfully accepted the suggestion.
514
515
Consequently, the further workflow execution is skipped.
515
516
517
+
### Custom-output-formatter
518
+
519
+
The output of the `debug` method can be controlled via an implementation of the `OutputFormat` interface.
520
+
By default a string representation of the execution will be returned (just like the example outputs).
521
+
522
+
Currently the following additional formatters are implemented:
523
+
524
+
| Formatter | Description |
525
+
| --------------- | ------------- |
526
+
|`StringLog`| The default formatter. Creates a string representation. <br />Example:<br />`$result->debug();`|
527
+
|`WorkflowGraph`| Creates a SVG file containing a graph which represents the workflow execution. The generated image will be stored in the provided target directory. Requires `dot` executable.<br />Example:<br />`$result->debug(new WorkflowGraph('/var/log/workflow/graph'));`|
528
+
|`GraphViz`| Returns a string containing [GraphViz](https://graphviz.org/) code for a graph representing the workflow execution. <br />Example:<br />`$result->debug(new GraphViz());`|
0 commit comments