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
Copy file name to clipboardExpand all lines: README.md
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -300,26 +300,32 @@ public function warning(string $message, ?Exception $exception = null): void;
300
300
If some of your steps become more complex you may want to have a look into the `NestedWorkflow` wrapper which allows you to use a second workflow as a step of your workflow:
301
301
302
302
```php
303
+
$parentWorkflowContainer = (new \PHPWorkflow\State\WorkflowContainer())->set('parent-data', 'Hello');
304
+
$nestedWorkflowContainer = (new \PHPWorkflow\State\WorkflowContainer())->set('nested-data', 'World');
305
+
303
306
$workflowResult = (new \PHPWorkflow\Workflow('AddSongToPlaylist'))
Each nested workflow must be executable (contain at least one **Process** step).
318
322
319
323
The debug log of your nested workflow will be embedded in the debug log of your main workflow.
320
324
321
-
As you can see in the example you can't inject a **WorkflowContainer** into the nested workflow.
322
-
The nested workflow has access to your main workflow container and can read or add data to the container.
325
+
As you can see in the example you can inject a dedicated **WorkflowContainer** into the nested workflow.
326
+
The nested workflow will gain access to a merged **WorkflowContainer** which provides all data and methods of your main workflow container and your nested container.
327
+
If you add additional data to the merged container the data will be present in your main workflow container after the nested workflow execution has been completed.
328
+
For example your implementations of the steps used in the nested workflow will have access to the keys `nested-data` and `parent-data`.
0 commit comments