Download the PHP package jardissupport/workflow without Composer
On this page you can find all versions of the php package jardissupport/workflow. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jardissupport/workflow
More information about jardissupport/workflow
Files in jardissupport/workflow
Package workflow
Short Description Directed workflow engine with status-based transitions, automatic data accumulation, and builder API
License MIT
Homepage https://jardis.io
Informations about the package workflow
Jardis Workflow
Part of Jardis — the Domain-Driven Design platform for PHP. You model your domain; Jardis generates the production-ready hexagonal code (DTOs, Command/Query handlers, repositories, persistence). This package is part of the open-source foundation that generated code runs on.
Directed workflow engine for multi-step process orchestration in PHP. Define handler graphs with named transitions, propagate every step's result through a typed context, and wire it all up with a fluent API. Each handler returns a WorkflowResult whose status — one of seven ON_* constants — picks the next step.
Features
- Directed Handler Graph — connect handlers as nodes with explicit per-status transitions
- Seven Named Transitions —
onSuccess,onFail,onTimeout,onSkip,onCancel,onEvent,onExit(loop/block termination) - R5 Routing-Safety — when a transition target is not a registered node, the engine returns control to the caller (no dispatch, no exception)
- Opt-in Strict Routing —
new WorkflowConfig(strictRouting: true)requires every status a handler can emit to be a declared transition key;'STATUS' => nullmarks a deliberate terminal end, a missing key raisesUnroutedStatusException. Default (false) preserves the previous non-strict-routing default behaviour byte-for-byte - Typed Execution Context —
WorkflowContextcarries every handler invocation as an entry in an ordered execution log;getPrevious()exposes the immediate predecessor's result without the handler needing to know who that was - Lossless History — re-invocations of the same handler (retry loops, cross-branch revisits) append a new entry instead of overwriting;
getAll(Foo::class)returns every invocation,getLatest(Foo::class)the most recent - Fluent Builder API —
WorkflowBuilder+WorkflowNodeBuilderwire the graph without configuration arrays - Handler Factory — inject a closure to resolve handlers from a DI container
- WorkflowResult — typed value object with named status constants; no ambiguous truthy/falsy returns
- WorkflowState — recommended typed
WorkflowContextInterfacefor process orchestrators: apayload → original → modifiedthree-step, passed in as the engine's optional$contextargument
Installation
Quick Start
Advanced Usage
Strict Routing (Opt-in)
With strictRouting: true, every status a handler can emit must be a declared transition key
for that node — 'onFail' => null is a deliberate terminal end. A status with no key at all
raises UnroutedStatusException (getNode() / getStatus()). Default is false, unchanged
from the pre-strict-routing default: an unmapped status silently ends the run, and the R5 hand-off (a mapped target that
is not itself a registered node) stays legal either way.
Documentation
Full documentation, guides, and API reference:
docs.jardis.io/en/support/workflow
License
This package is licensed under the MIT License.
Jardis · Documentation · Headgent
AI-Assisted Development
This package ships with a skill for Claude Code, Cursor, Continue, and Aider. Install it in your consuming project:
More details: https://docs.jardis.io/en/skills