softius/phlow 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

softius/phlow

Composer 安装命令:

composer require softius/phlow

包简介

A framework agnostic PHP library to build and execute workflows

README 文档

README

Latest Version on Packagist Software License Build Status Code Climate Code Climate

Phlow is a workflow modeller and engine for PHP. Heavily inspired by BPMN 2.0 and Apache Camel, Phlow attempts to provide a library to design and implement business processes in PHP projects. It utilises the notion of workflow to model a process of any kind, through which a piece of work passes from initiation to completion.

Phlow process models can be created using PHP. No third party tools are required to model and/or execute your process.

Phlow is a framework agnostic solution.

Features

✅ Sequence flow
✅ Conditional flow
✅ Error handling
✅ Callbacks
✅ Boolean expressions for Conditions
✅ PSR/3 Logger integration
✅ Execution path replay
✅ Workflow model in plain/text format
✅ Execution path in plain/text format

See the Roadmap for more information about the upcoming releases.

Getting Started

The following image illustrates a simple process for dealing with a non-functioning lamp. Once a non-functioning lamp is found, the flow evaluates whether the lamp is plugged in. If not, it evaluates whether the lamp has been burned out. In any case, particular actions must be taken i.e. replace the lamp.

A simple flowchart for troubleshooting a broken lamp.

Also, the following code illustrates the model for the same process.

$builder = new WorkflowBuilder();
$builder
  ->start()
  ->choice()
  ->when('isPluggedIn')
    ->callback()          // Plug in lamp
  ->when('isBurnedOut')
    ->callback()          // Replace lamp
  ->otherwise()
    ->callback()          // Repair lamp
  ->endAll()

Once the model bas been built, it can be executed by creating a new instance. At this point it is possible to pass some data that could be made available throughout the process. The data can be any object which could be also updated as part of the process.

$workflow = $builder->getWorkflow();
$instance = new WorkflowInstance($workflow, $data);
$instance->execute();

Installation

Phlow can be installed to your PHP project by executing the following composer command. Please note that currently there is no stable version yet available.

$ composer require softius/phlow 0.4.0

Documentation

Testing

$ composer test

Security

If you discover any security related issues, please email softius@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 14
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 13
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固