Releases: wol-soft/php-workflow
Releases · wol-soft/php-workflow
Step dependencies
Each workflow step implementation can now define step dependencies which are evaluated before the step is executed:
public function run(
\PHPWorkflow\WorkflowControl $control,
// The key customerId must contain a string
#[\PHPWorkflow\Step\Dependency\Required('customerId', 'string')]
// The customerAge must contain an integer. But also null is accepted.
// Each type definition can be prefixed with a ? to accept null.
#[\PHPWorkflow\Step\Dependency\Required('customerAge', '?int')]
// Objects can also be type hinted
#[\PHPWorkflow\Step\Dependency\Required('created', \DateTime::class)]
\PHPWorkflow\State\WorkflowContainer $container,
) {
// Implementation which can rely on the defined keys to be present in the container.
}
See the Readme for more details.
Custom output formatter
New features
Adds support for custom output formatter. The following formatters are implemented by the library:
- GraphViz: generates GraphViz code which represents the workflow execution
- WorkflowGraph: generates a SVG file which displays a graph representing the workflow execution
Breaking changes
- The function signature of the
WorkflowStep::run
method has changed. The method must returnvoid
- The array returned by the method
WorkflowResult::getWarnings
is now indexed by integer values represented by theSTAGE_*
constants defined inWorkflowState
instead of a textual representation of the stage. To get the textual representation the static methodExecutionLog::mapStage(int $stage): string
can be used - The debug output for loops has changed slightly:
- A
start
entry has been added - Loops are indented now
- A
Add support for loops ➰
View the readme to get more information about loops