iammerus/flowy
Composer 安装命令:
composer require iammerus/flowy
包简介
Flowy - A PHP Workflow Engine
README 文档
README
Flowy is a modern, extensible PHP workflow engine designed for robust, maintainable, and scalable workflow automation. Built with PHP 8.1+, it leverages modern language features, strict typing, and a modular architecture for maximum flexibility and developer experience.
🚀 Getting Started
Installation
Install Flowy via Composer:
composer require iammerus/flowy
Minimal Example: Define and Run a Workflow
use Flowy\Model\Data\WorkflowDefinition; use Flowy\Model\Data\StepDefinition; use Flowy\Registry\InMemoryDefinitionRegistry; use Flowy\Engine\WorkflowEngineService; use Flowy\Context\WorkflowContext; // 1. Define a workflow and its steps $step = new StepDefinition( 'start', [], [], 'Start', 'The initial step.', true, 'action', null, null ); $workflow = new WorkflowDefinition( 'demo_workflow', '1.0.0', 'start', [$step], 'Demo Workflow', 'A simple demo workflow.' ); // 2. Register the workflow definition $registry = new InMemoryDefinitionRegistry(); $registry->addDefinition($workflow); // 3. Create the engine (using in-memory persistence for demo) $engine = new WorkflowEngineService( $registry, /* PersistenceInterface */ new class implements \Flowy\Persistence\PersistenceInterface { public function save($instance) { /* ... */ } public function find($id) { /* ... */ } public function findByBusinessKey($defId, $key) { /* ... */ } public function findInstancesByStatus($status) { /* ... */ } }, /* EventDispatcherInterface */ new \Flowy\Event\NullEventDispatcher() ); // 4. Start a workflow instance $context = new WorkflowContext(['foo' => 'bar']); $instance = $engine->start('demo_workflow', '1.0.0', $context); echo "Started instance: " . $instance->id->toString() . PHP_EOL;
Running Tests, Static Analysis, and Code Style Checks
- Run tests:
composer test - Run static analysis (PHPStan):
composer stan
- Check code style (PSR-12):
composer cs
📚 Further Documentation
- See docs/CoreConcepts.md for an overview of Flowy's core concepts.
Flowy is open-source and welcomes contributions! Please see the roadmap and specification before submitting PRs.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-16