Code Monkey home page Code Monkey logo

laravel_workflower's Introduction

Workflower with laravel. A Bussines Process Implementation with PHP

Table of Contents

Introduction

This project is an example of https://github.com/phpmentors-jp/workflower BPMN 2.0 workflow engine and Laravel 5.8 Framework integration.

I used https://github.com/77web/workflower-bundle-playground example as basis.

The bpmn file can be viewed and edited with comunda modeler. The service tasks are not supported by the visual editor but you can edit directly in the source code.

Installation

Run composer install and and php artisan migrate command.

The workflow diagram

documentation/img/pullrequest_process.png

Sourcecode

Workflow implementations

The class Process does the magic and we focus in this.

This class needs three class to work.

  1. A WorkItemContextInterface implementation (PullRequestWorkflow). This class has the workflow bpmn file name saved in the storage/app/process path.
  2. A Bpmn2WorkflowRepository implementation (WorkflowRepository). The phpmentors-jp/workflower has an implementation but is useless for laravel projects.
  3. A MergePullRequestOperationRunner implementation (MergePullRequestOperationRunner). This class contains the logic used by the service task merge PR. For laravel projects you most consider replace service task for simple task and use Jobs.

Additionally to this classes I create the class Workflow/Entities/PullRequest that implements ProcessContextInterface and WorkflowSerializableInterface interfaces. This class it is a data structure that has the necessary data for the workflow to work.

With this classes create a Process instance.

$repository = new WorkflowRepository();
$pullRequestWorkflow = new PullRequestWorkflow();
$operationRunner = new MergePullRequestOperationRunner();
$process = new Process($pullRequestWorkflow, $repository, $operationRunner);

We set the instance in the Usecase class and pass the Pullrequest instance in the run method.

$usecase = new CreatePullRequestUsecase();
$usecase->setProcess($process); // createProcess() method in the controller class
$entity = $usecase->run($pullrequest); // $entity attribute in the controller class
return $entity;

Laravel

For persistence I create a eloquent model Models/PullRequest. This class save the data in the database including the serialized workflow.

The PullRequestController is the application's start point. This class makes the calls to the workflower engine through Usecase classes.

Screenshots

lista de pullrequest creados

documentation/img/index.png

documentation/img/index.png

laravel_workflower's People

Contributors

dependabot[bot] avatar ghidalgo1 avatar marunrun avatar rockancun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravel_workflower's Issues

Question about type of BPMN modeler that is used in this project

Thanks for this great project that I think is the only available laravel project version of workflower.
The question is, would you please say which BPMN modeler is used to create this BPMN diagram?
I opened the PullRequestProcess.bpmn in Camunda modeler, but can't understand how to find interface tag related to merge pr service task in camunda and how to change it?
thanks.

In PackageManifest.php line 122: Undefined index: name

Hi,

I've downloaded the zip of this project and run command "composer install" in terminal. I'm getting below error (attached screenshot) in between.

In PackageManifest.php line 122:
                         
  Undefined index: name  
                         

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Can you please tell me what is wrong here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.