A BPMN 2.0 workflow engine for PHP

Overview

Workflower

A BPMN 2.0 workflow engine for PHP

Workflower is a BPMN 2.0 workflow engine for PHP. Workflower runs business processes using the BPMN 2.0 specification. It's open-source and distributed under the BSD 2-Clause License.

Total Downloads Latest Stable Version Latest Unstable Version Build Status

Features

  • Workflow
    • The workflow engine and domain model
  • Process
    • Some interfaces to work with Workflow objects
  • Definition
    • BPMN 2.0 process definitions
  • Persistence
    • Serialize/deserialize interfaces for Workflow objects

Supported workflow elements

  • Connecting objects
    • Sequence flows
  • Flow objects
    • Activities
      • Tasks
      • Service tasks
      • Send tasks
    • Events
      • Start events
      • End events
    • Gateways
      • Exclusive gateways
  • Swimlanes
    • Lanes

Installation

Workflower can be installed using Composer.

Add the dependency to phpmentors/workflower into your composer.json file as the following:

Stable version:

composer require phpmentors/workflower "1.4.*"

Development version:

composer require phpmentors/workflower "~2.0@dev"

Documentation

Support

If you find a bug or have a question, or want to request a feature, create an issue or pull request for it on Issues.

Copyright

Copyright (c) 2015-2019 Atsuhiro Kubo and contributors, All rights reserved.

License

The BSD 2-Clause License

Comments
  • Workflow refactoring

    Workflow refactoring

    | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | yes | Deprecations? | yes | Tests pass? | yes | Fixed tickets | https://github.com/phpmentors-jp/workflower/issues/79, https://github.com/phpmentors-jp/workflower/issues/80, https://github.com/phpmentors-jp/workflower/issues/82, https://github.com/phpmentors-jp/workflower/issues/83 | License | BSD-2-Clause

    New features included in this PR:

    • UserTask
    • ManualTask
    • parallel and sequential work items in tasks
    • InclusiveGateway
    • TerminateEndEvent
    • bpmn reader class can import above mentioned elements

    Prepared the basics for implementing SubProcess Task and CallActivity Task.

    opened by ateodorescu 11
  • Parallel Gateways & Workflows

    Parallel Gateways & Workflows

    Hi.

    Can I use workflower for parallel workflows ? I don't see parallel gateway in your project. How about "diverging" and "converging" parallel gateways ?

    How about another types of gateways ?

    Please tell me how to implement parallel gateways and workflows with workflower ?

    Thanks. Jalaal

    question 
    opened by MrBugMiner 5
  • Laneless process fails for no roles

    Laneless process fails for no roles

    | Q | A | ------------- | --- | Branch? | 1.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | BSD-2-Clause

    If a process only has participants without lanes, the participant can act as the role. I'm not completely certain this is the right approach, but at the moment, not having a lane split causes the reader to crash.

    opened by SirWaddles 3
  • Process ends when all tokens are consumed

    Process ends when all tokens are consumed

    To quote from the BPMN specification: "To continue discussing how flow proceeds throughout the Process, an End Event consumes a token that had been generated from a Start Event within the same level of Process. If parallel Sequence Flows targets the End Event, then the tokens will be consumed as they arrive. All the tokens that were generated within the Process MUST be consumed by an End Event before the Process has been completed." (page 245 from "Business Process Model and Notation (BPMN), v2.0.2")

    Basically we have to change the workflow so that when "end" is called we consume the tokens as they arrive. When the last one is consumed we could set the "endDate" as a property on the workflow and also have a "closed" property on the Workflow class.

    At the moment "isClosed" is actually checking if all remaining tokens are "End" events.

    What do you think @iteman ?

    I could push a PR to solve this.

    enhancement 
    opened by ateodorescu 2
  • Parallel sequence flows

    Parallel sequence flows

    A sequence flow can have a condition defined on it. When a BPMN 2.0 activity is left, the default behaviour is to evaluate the conditions on the outgoing sequence flows. When a condition evaluates ‘true’, that outgoing sequence flow is selected. When multiple sequence flows are selected that way, multiple executions will be generated and the process is continued in a parallel way.

    enhancement 
    opened by ateodorescu 2
  • Support for BPMN models without swimlanes

    Support for BPMN models without swimlanes

    | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #23 | License | BSD-2-Clause

    This will provide support for BPMN models without swimlanes by providing the default role. All existing assertions in allocateWorkItem() / startWorkItem() / completeWorkItem() on Workflow that assert the participant acts as the given role will still be called with the default role ID __ROLE__.

    enhancement 
    opened by iteman 2
  • Terminate End Event

    Terminate End Event

    Quotes from BPMN specification (Business Process Model and Notation (BPMN), v2.0.2):

    • "If a token reaches a Terminate End Event, the entire Process is abnormally terminated." (chapter 13.5.6)
    • "For a “terminate” End Event, the Process is abnormally terminated—no other ongoing Process instances are affected." (page 443)
    • "For a “terminate” End Event, the Sub-Process is abnormally terminated. In case of a multi-instance Sub-Process, only the affected instance is terminated—no other ongoing Sub-Process instances or higher-level Sub-Process or Process instances are affected." (chapter 13.5.6)

    Basically when a token reaches the Terminate End Event all other existing tokens should be consumed and the active activities should be cancelled. This means that existing work items should be cancelled. If an activity has sub-processes then those process instances should be cancelled. The ProcessInstance could be marked an abnormally terminated.

    enhancement 
    opened by ateodorescu 1
  • Process should consume all tokens in End Events

    Process should consume all tokens in End Events

    | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | yes | Deprecations? | yes | Tests pass? | yes | Fixed tickets | https://github.com/phpmentors-jp/workflower/issues/74 | License | BSD-2-Clause

    opened by ateodorescu 1
  • Serializing Error in ExclusiveGateway Class.

    Serializing Error in ExclusiveGateway Class.

    At line 61 serialize ExclusiveGateway class the attibute defaultSequenceFlow is renamed for defaultSequenceFlowId.

    When unserialize the object lost the value of attribute defaultSequenceFlow

    public function serialize() { return serialize(array( 'id' => $this->id, 'name' => $this->name, 'role' => $this->role, 'defaultSequenceFlow' => $this->defaultSequenceFlowId, )); }

    bug 
    opened by rockancun 1
  • The service

    The service "phpmentors_workflower.security_participant" has a dependency on a non-existent service "security.access.role_hierarchy_voter".

    Hi! I install symfony


    Symfony


    Version 3.3.6 End of maintenance 01/2018 End of life 07/2018


    Kernel


    Type AppKernel Name app Environment dev Debug true Charset UTF-8 Root directory ./app Cache directory ./var/cache/dev (1.5 MiB) Log directory ./var/logs (1 KiB)


    PHP


    Version 7.0.20 Architecture 64 bits Intl locale n/a Timezone Europe/Moscow (2017-08-23T15:26:39+03:00) OPcache true APCu true Xdebug true


    and install bundle how in docs. But when i open site i see: image

    wontfix 
    opened by Slavenin 1
  • 1.3.0 release

    1.3.0 release

    • [x] Create 1.3 branch for the release if it does not exist
    • [x] Change the branch of the build status in README.md if the branch is newly created (1.3)
    • [x] Change README.md on the release branch. (1.3)
    • [x] Tag to the release on git with the command git tag -s v1.3.0 HEAD (1.3)
    • [x] Push changes to GitHub with the command git push upstream 1.3 and git push upstream --tags (1.3)
    • [x] Create a new draft release as Workflower 1.3.0 (stable) (GitHub)
    • [x] Publish the release
    • [x] Update wiki pages (Home)
    • [x] Update the version in README.md and composer.json from 1.2 to 1.3 if 1.3 branch is newly created (master)
    • [x] Push changes to GitHub with the command git push upstream master (master)
    • [x] Remove unnecessary releases in Packagist
    • [x] Remove unnecessary branches in GitHub
    • [x] Tweet the release
    task release 
    opened by iteman 1
  • Question about How to run workflow diagram

    Question about How to run workflow diagram

    i clone workflow project in symfony application in local and after i install composer require packages and after i run the project i get error local server page not found please tell me know how ccan i solved?

    opened by niraliladva 0
  • Does Workflower handle subprocess?

    Does Workflower handle subprocess?

    Hi, first of all thank you for this great package. Awesome one! Recently I've tried to add a sub process to my simple workflow, but I got error about sub process ID. The question is, does workflower handle a sub process?

    Thanks,

    opened by zahra-ove 0
  • Type error

    Type error

    Argument 1 passed to PHPMentors\Workflower\Workflow\ProcessInstance::allocateWorkItem() must implement interface PHPMentors\Workflower\Workflow\Activity\WorkItemInterface, instance of PHPMentors\Workflower\Workflow\Activity\Task given, called in /workspaces/shipping-fee-center/vendor/phpmentors/workflower/src/Process/Process.php on line 98[434]

    opened by SaylorZhu 1
  • PHP Fatal error

    PHP Fatal error

    PHP Fatal error: Class PHPMentors\Workflower\Process\WorkItemContext contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (PHPMentors\Workflower\Process\WorkItemContextInterface::getWorkItemId)

    opened by SaylorZhu 1
  • Serialise/deserialise a ProcessInstance

    Serialise/deserialise a ProcessInstance

    The current implementation of serialisation/deserialisation is not really useful if you want to save process instances in a database. You can't store them serialised because you can't do any kind of report on the process data not to mention sorting/filtering data in a work list..

    In a database one would save the following data for a ProcessInstance:

    • id, name, idProcessDefinitionVersion, process data
    • all tokens available
    • all work items available and the activities they are linked to.
    • all sub-process instances and the activities they are linked to (this is not implemented yet)

    So the ProcessInstance class could be modified to serialise/deserialise only the data described above. Anyone agrees to this? Anyone working on this already?

    opened by ateodorescu 0
Releases(v1.4.1)
  • v1.4.1(Dec 7, 2019)

    This will be the final release for 1.x.

    What's New in Workflower 1.4.1

    Bug fixes

    • bug #55 Serializing Error in ExclusiveGateway Class. (@iteman)
    Source code(tar.gz)
    Source code(zip)
  • v1.4.0(Jan 31, 2018)

    This will be the final release for 1.x.

    What's New in Workflower 1.4.0

    New dependency versions

    (@iteman, #42)

    This will change some dependency versions including PHP as follows:

    • piece/stagehand-fsm: >= 2.6.0
    • symfony/expression-language: >= 2.8.0 or >= 3.4.0 or >= 4.0.0
    Source code(tar.gz)
    Source code(zip)
  • v1.3.1(May 12, 2017)

  • v1.3.0(Mar 10, 2017)

    What's New in Workflower 1.3.0

    Support for BPMN models without swimlanes

    (@iteman, #24)

    This provides support for BPMN models without swimlanes by providing the default role. All existing assertions in allocateWorkItem() / startWorkItem() / completeWorkItem() on Workflow that assert the participant acts as the given role will still be called with the default role ID __ROLE__.

    Send Task support

    (@SirWaddles, #25)

    Send Tasks have been supported. As per the BPMN2 specification, since a Send Task operation will send a message and then complete itself (and also has a field for operation reference), it uses the same mechanism as the OperationalInterface so can be passed to the OperationRunner for sending (check if implements MessageInterface).

    Reading document from string

    (@SirWaddles, #17)

    A workflow definition can be read from XML string by using Bpmn2Reader::readSource().

    New minimum required Symfony version

    (@iteman, #27)

    As of this version, Symfony 2.8.0 or greater is required.

    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Oct 31, 2016)

    Release Date: 2016-10-31 UTC

    What's New in Workflower 1.2.0

    Service Task support

    (@iteman, Issue #15)

    Service Tasks have been supported. Here is an example definition of Service Tasks:

    <?xml version="1.0" encoding="UTF-8"?>
    <bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ext="http://org.eclipse.bpmn2/ext" xmlns:xs="http://www.w3.org/2001/XMLSchema" id="Definitions_1" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.3.1.Final-v20160914-1606-B56" targetNamespace="http://org.eclipse.bpmn2/default/process">
      <bpmn2:message id="Message_2" name="Message 2"> // A message element that can be shared by all operations.
        <bpmn2:extensionElements>
          <ext:style/>
        </bpmn2:extensionElements>
      </bpmn2:message>
      <bpmn2:interface id="Interface_2" name="Interface 2">
        <bpmn2:operation id="Operation_2" name="phpmentors_workflower.service1"> // An operation named as `phpmentors_workflower.service1` for Service Tasks. In PHPMentorsWorkflowerBundle, `phpmentors_workflower.service1` is treated as the service ID for the DI container.
          <bpmn2:inMessageRef>Message_2</bpmn2:inMessageRef>
        </bpmn2:operation>
        <bpmn2:operation id="Operation_3" name="phpmentors_workflower.service2"> // An operation named as `phpmentors_workflower.service2` for Service Tasks.
          <bpmn2:inMessageRef>Message_2</bpmn2:inMessageRef>
        </bpmn2:operation>
      </bpmn2:interface>
      <bpmn2:process id="ServiceTasksProcess" name="Default Process" isExecutable="false">
        ...
        <bpmn2:serviceTask id="ServiceTask_1" name="Service Task 1" operationRef="Operation_2"> // A Service Task that will be processed by the operation `phpmentors_workflower.service1`.
          <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
          <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
          <bpmn2:ioSpecification id="InputOutputSpecification_6">
            <bpmn2:inputSet id="InputSet_10" name="Input Set 10"/>
            <bpmn2:outputSet id="OutputSet_10" name="Output Set 10"/>
          </bpmn2:ioSpecification>
        </bpmn2:serviceTask>
        <bpmn2:serviceTask id="ServiceTask_2" name="Service Task 2" operationRef="Operation_3"> // A Service Task that will be processed by the operation `phpmentors_workflower.service2`.
          <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
          <bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing>
          <bpmn2:ioSpecification id="InputOutputSpecification_10">
            <bpmn2:inputSet id="InputSet_19" name="Input Set 19"/>
            <bpmn2:outputSet id="OutputSet_19" name="Output Set 19"/>
          </bpmn2:ioSpecification>
        </bpmn2:serviceTask>
        ...
    

    Of course, you should use a graphical BPMN editor to edit BPMN files.

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Apr 27, 2016)

    Release Date: 2016-04-27 UTC

    What's New in Workflower 1.1.0

    WorkflowContextInterface

    (@iteman, Issue #12)

    A WorkflowContextInterface object is the replacement of a bare workflow ID. This allows you to use arbitrary specification of the Workflow ID. For example, see WorkflowContext in PHPMentorsWorkflowerBundle.

    An ExpressionLanguage object can be specified

    (@77web, Issue #11)

    An ExpressionLanguage object can be specified to a Workflow object by Workflow::setExpressionLanguage().

    A ParticipantInterface object can be specified

    (@iteman, Issue #8)

    An ParticipantInterface object can be specified to a WorkItemContext object by WorkItemContext::setParticipant(). This allows you to allocate an acting participant instead of the authenticated participant.

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Jul 22, 2015)

Owner
PHP Mentors
PHP Mentors is a service that provides training, technical support, mentoring, etc. for PHP programmers.
PHP Mentors
PHP Image Manipulation

Intervention Image Intervention Image is a PHP image handling and manipulation library providing an easier and expressive way to create, edit, and com

null 13k Jan 3, 2023
PHP 5.3 Object Oriented image manipulation library

Imagine Tweet about it using the #php_imagine hashtag. Image manipulation library for PHP 5.3 inspired by Python's PIL and other image libraries. Requ

Bulat Shakirzyanov 4.3k Jan 6, 2023
🌄 Perceptual image hashing for PHP

ImageHash A perceptual hash is a fingerprint of a multimedia file derived from various features from its content. Unlike cryptographic hash functions

Jens Segers 1.9k Dec 28, 2022
GifCreator is a PHP class that creates animated GIF from multiple images

================================ GifCreator ================================ GifCreator is a PHP class to create animated GIF from multiple images For

Clément Guillemain 320 Dec 15, 2022
GifFrameExtractor is a PHP class that separates all the frames (and their duration) of an animated GIF

================================ GifFrameExtractor ================================ GifFrameExtractor is a PHP class that separates all the frames (an

Clément Guillemain 173 Dec 12, 2022
Image Cache is a very simple PHP class that accepts an image source and will compress and cache the file, move it to a new directory, and returns the new source for the image.

NO LONGER MAINTAINED!!! Image Cache v. 1.0.0 Image Cache is a very simple PHP class that accepts an image source and will compress and cache the file,

Erik Nielsen 455 Dec 30, 2022
PHP Captcha library

Captcha Installation With composer : { ... "require": { "gregwar/captcha": "1.*" } } Usage You can create a captcha with the Captc

Grégoire Passault 1.6k Dec 25, 2022
A Sharex IMG uploader that runs with PHP | Use a hosting site if you're a beginner use 000webhost

Sharex-Img-Uploader A Sharex IMG uploader that runs with PHP | Use a hosting site if you're a beginner use 000webhost Setting up SXCU In YOUR_DOMAIN_U

Pix 10 Nov 26, 2022
A PHP GD + TwitterOAuth demo to dynamically generate Twitter header images and upload them via the API.

A PHP GD + TwitterOAuth demo to dynamically generate Twitter header images and upload them via the API. This enables you to build cool little tricks, like showing your latest followers or sponsors, latest content creted, a qrcode to something, a progress bar for some goal, and whathever you can think of.

Erika Heidi 172 Jan 5, 2023
php-gd based image templates

gdaisy A highly experimental image templating system based on PHP-GD to dynamically generate image banners and covers. Installation 1. Require erikahe

Erika Heidi 67 Nov 22, 2022
Instagram with ImageMagick & PHP

Instagraph - Instagram with ImageMagick & PHP In this repository, I’ll demonstrate you how to create vintage (just like Instagram does) photos effects

Dejan Marjanovic 326 Nov 3, 2022
Grabs the dominant color or a representative color palette from an image. Uses PHP and GD, Imagick or Gmagick.

Color Thief PHP A PHP class for grabbing the color palette from an image. Uses PHP and GD or Imagick libraries to make it happen. It's a PHP port of t

Kevin Subileau 610 Dec 28, 2022
An easy-to-use PHP QrCode generator with first-party support for Laravel.

An easy-to-use PHP QrCode generator with first-party support for Laravel.

Simple Software LLC 2.2k Jan 5, 2023
Get started with the Microsoft Graph SDK for PHP

If you want to play around with the PHP library, you can get up and running quickly with the PHP Connect Sample. This sample will start you with a little Laravel project that helps you with registration, authentication, and making a simple call to the service.

Microsoft Graph 423 Dec 28, 2022
This is a class of php QR Code, This library helps you generate QR codes in a jiffy.

This is a class of php QR Code, This library helps you generate QR codes in a jiffy.

null 59 Oct 5, 2022
phpThumb() - The PHP thumbnail generator

phpThumb phpThumb() - The PHP thumbnail generator phpThumb() uses the GD library and/or ImageMagick to create thumbnails from images (GIF, PNG or JPEG

James Heinrich 292 Dec 17, 2022
A library using PHP to generate QRCode from https://www.qrcode-monkey.com free

PHP Class Generate Free QRCode ?? A library using PHP to generate QRCode from https://www.qrcode-monkey.com free ✋ NOTE: Do not generate too many QRCo

Nguyen Truong Nguyen 53 Dec 28, 2022
PHP library to resize, scale and crop images.

PHP library to resize, scale and crop images.

Gumlet 1.1k Jan 3, 2023