Skip to content

Commit 75201d5

Browse files
committed
wip
1 parent 4bcef38 commit 75201d5

File tree

6 files changed

+161
-20
lines changed

6 files changed

+161
-20
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
4-
url: https://github.com//laravel-workflow-engine/discussions/new?category=q-a
4+
url: https://github.com//workflow-mastery/discussions/new?category=q-a
55
about: Ask the community for help
66
- name: Request a feature
7-
url: https://github.com//laravel-workflow-engine/discussions/new?category=ideas
7+
url: https://github.com//workflow-mastery/discussions/new?category=ideas
88
about: Share ideas for new features
99
- name: Report a security issue
10-
url: https://github.com//laravel-workflow-engine/security/policy
10+
url: https://github.com//workflow-mastery/security/policy
1111
about: Learn how to notify us for sensitive bugs

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Changelog
22

3-
All notable changes to `laravel-workflow-engine` will be documented in this file.
3+
All notable changes to `workflow-mastery` will be documented in this file.

README.md

Lines changed: 151 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,156 @@
1-
# This is my package laravel-workflow-engine
21

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v//laravel-workflow-engine.svg?style=flat-square)](https://packagist.org/packages//laravel-workflow-engine)
4-
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status//laravel-workflow-engine/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com//laravel-workflow-engine/actions?query=workflow%3Arun-tests+branch%3Amain)
5-
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status//laravel-workflow-engine/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com//laravel-workflow-engine/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
6-
[![Total Downloads](https://img.shields.io/packagist/dt//laravel-workflow-engine.svg?style=flat-square)](https://packagist.org/packages//laravel-workflow-engine)
2+
# Workflow Mastery: A Universal Workflow Engine
3+
4+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/solution-forest/workflow-mastery.svg?style=flat-square)](https://packagist.org/packages/solution-forest/workflow-mastery)
5+
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/solution-forest/workflow-mastery/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/solution-forest/workflow-mastery/actions?query=workflow%3Arun-tests+branch%3Amain)
6+
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/solution-forest/workflow-mastery/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/solution-forest/workflow-mastery/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
7+
[![Total Downloads](https://img.shields.io/packagist/dt/solution-forest/workflow-mastery.svg?style=flat-square)](https://packagist.org/packages/solution-forest/workflow-mastery)
8+
9+
---
10+
11+
## What is a Workflow Engine?
12+
13+
A **workflow engine** is a software component that manages and executes defined sequences of tasks, called workflows. It allows you to model business processes, automate repetitive tasks, and coordinate actions across systems or modules. By decoupling process logic from application code, workflow engines make your systems more flexible, maintainable, and adaptable to change.
14+
15+
### Real-World Examples
16+
17+
- **Order Processing**: E-commerce platforms use workflows to handle order validation, payment, inventory checks, shipping, and notifications.
18+
- **Document Approval**: HR or legal departments automate document review, approval, and archiving.
19+
- **CI/CD Pipelines**: DevOps tools like GitHub Actions, Jenkins, or GitLab CI define build, test, and deploy workflows.
20+
21+
### Workflow Engines in Other Languages
22+
23+
- **Java**: [Camunda](https://camunda.com/), [Activiti](https://www.activiti.org/)
24+
- **C#/.NET**: [Elsa Workflows](https://elsa-workflows.github.io/elsa-core/)
25+
- **Ruby**: [Ruote](https://github.com/jmettraux/ruote)
26+
- **Go**: [Conductor](https://github.com/netflix/conductor), [Temporal](https://temporal.io/)
27+
- **Rust**: [rusty-workflow](https://github.com/whatisinternet/rusty-workflow)
28+
29+
---
30+
31+
## Why "Workflow Mastery"?
32+
33+
Inspired by the best ideas from many languages and platforms, **Workflow Mastery** aims to be a universal, modular, and extensible workflow engine. While it integrates seamlessly with Laravel, its core logic is designed to be framework-agnostic, so you can use it anywhere.
34+
35+
---
36+
37+
## Design Philosophy & Best Practices
38+
39+
- **Separation of Concerns**: Keep workflow definitions and execution logic outside of business modules.
40+
- **Extensibility**: Support custom actions, conditions, and event hooks.
41+
- **Portability**: Core logic should not depend on Laravel or any specific framework.
42+
- **Declarative DSL**: Define workflows in a simple, human-readable format (YAML, JSON, PHP array, etc).
43+
- **Persistence Agnostic**: Allow pluggable storage (DB, file, memory, etc).
44+
- **Observability**: Provide hooks for logging, monitoring, and debugging.
45+
46+
---
47+
48+
## Example: Laravel Workflow Definition (Simple DSL)
49+
50+
```php
51+
$workflow = [
52+
'name' => 'Order Processing',
53+
'steps' => [
54+
['name' => 'Validate Order', 'action' => 'App\\Actions\\ValidateOrder'],
55+
['name' => 'Charge Payment', 'action' => 'App\\Actions\\ChargePayment'],
56+
['name' => 'Update Inventory', 'action' => 'App\\Actions\\UpdateInventory'],
57+
['name' => 'Send Confirmation', 'action' => 'App\\Actions\\SendConfirmationEmail'],
58+
],
59+
'transitions' => [
60+
['from' => 'Validate Order', 'to' => 'Charge Payment', 'condition' => 'orderIsValid'],
61+
['from' => 'Charge Payment', 'to' => 'Update Inventory'],
62+
['from' => 'Update Inventory', 'to' => 'Send Confirmation'],
63+
],
64+
];
65+
```
66+
67+
---
68+
69+
## Installation
70+
71+
You can install the package via composer:
72+
73+
```bash
74+
composer require solution-forest/workflow-mastery
75+
```
76+
77+
You can publish and run the migrations with:
78+
79+
```bash
80+
php artisan vendor:publish --tag="workflow-mastery-migrations"
81+
php artisan migrate
82+
```
83+
84+
You can publish the config file with:
85+
86+
```bash
87+
php artisan vendor:publish --tag="workflow-mastery-config"
88+
```
89+
90+
Optionally, you can publish the views using
91+
92+
```bash
93+
php artisan vendor:publish --tag="workflow-mastery-views"
94+
```
95+
96+
---
97+
98+
## Usage
99+
100+
```php
101+
$engine = new SolutionForest\WorkflowMastery();
102+
$engine->run($workflow, $data);
103+
```
104+
105+
---
106+
107+
## Suggestions for Flexibility
108+
109+
- Use interfaces for actions and conditions.
110+
- Allow dynamic workflow loading (from DB, files, or code).
111+
- Support async and parallel steps.
112+
- Provide adapters for different frameworks.
113+
- Make the engine observable (events, logs, metrics).
114+
115+
---
116+
117+
## Testing
118+
119+
```bash
120+
composer test
121+
```
122+
123+
## Changelog
124+
125+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
126+
127+
## Contributing
128+
129+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
130+
131+
## Security Vulnerabilities
132+
133+
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
134+
135+
## Credits
136+
137+
- [alan](https://github.com/)
138+
- [All Contributors](../../contributors)
139+
140+
## License
141+
142+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
143+
144+
[![Latest Version on Packagist](https://img.shields.io/packagist/v//workflow-mastery.svg?style=flat-square)](https://packagist.org/packages//workflow-mastery)
145+
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status//workflow-mastery/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com//workflow-mastery/actions?query=workflow%3Arun-tests+branch%3Amain)
146+
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status//workflow-mastery/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com//workflow-mastery/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
147+
[![Total Downloads](https://img.shields.io/packagist/dt//workflow-mastery.svg?style=flat-square)](https://packagist.org/packages//workflow-mastery)
7148

8149
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
9150

10151
## Support us
11152

12-
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/laravel-workflow-engine.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/laravel-workflow-engine)
153+
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/workflow-mastery.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/workflow-mastery)
13154

14155
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
15156

@@ -20,20 +161,20 @@ We highly appreciate you sending us a postcard from your hometown, mentioning wh
20161
You can install the package via composer:
21162

22163
```bash
23-
composer require /laravel-workflow-engine
164+
composer require /workflow-mastery
24165
```
25166

26167
You can publish and run the migrations with:
27168

28169
```bash
29-
php artisan vendor:publish --tag="laravel-workflow-engine-migrations"
170+
php artisan vendor:publish --tag="workflow-mastery-migrations"
30171
php artisan migrate
31172
```
32173

33174
You can publish the config file with:
34175

35176
```bash
36-
php artisan vendor:publish --tag="laravel-workflow-engine-config"
177+
php artisan vendor:publish --tag="workflow-mastery-config"
37178
```
38179

39180
This is the contents of the published config file:
@@ -46,7 +187,7 @@ return [
46187
Optionally, you can publish the views using
47188

48189
```bash
49-
php artisan vendor:publish --tag="laravel-workflow-engine-views"
190+
php artisan vendor:publish --tag="workflow-mastery-views"
50191
```
51192

52193
## Usage

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "solution-forest/laravel-workflow-engine",
3-
"description": "This is my package laravel-workflow-engine",
2+
"name": "solution-forest/workflow-mastery",
3+
"description": "This is my package workflow-mastery",
44
"keywords": [
55
"solutionforest",
66
"laravel",
7-
"laravel-workflow-engine"
7+
"workflow-mastery"
88
],
9-
"homepage": "https://github.com/solutionforest/laravel-workflow-engine",
9+
"homepage": "https://github.com/solutionforest/workflow-mastery",
1010
"license": "MIT",
1111
"authors": [
1212
{

src/Commands/LaravelWorkflowEngineCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class LaravelWorkflowEngineCommand extends Command
88
{
9-
public $signature = 'laravel-workflow-engine';
9+
public $signature = 'workflow-mastery';
1010

1111
public $description = 'My command';
1212

src/LaravelWorkflowEngineServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function configurePackage(Package $package): void
1616
* More info: https://github.com/spatie/laravel-package-tools
1717
*/
1818
$package
19-
->name('laravel-workflow-engine')
19+
->name('workflow-mastery')
2020
->hasConfigFile()
2121
->hasViews()
2222
->hasMigration('create_laravel_workflow_engine_table')

0 commit comments

Comments
 (0)