pvm – PHP Process virtual machine for building and executing workflows

At some point last year I wrote the blog post titled “Getting started with workflows in PHP“.  I received quite a bit of feedback about it, but, unfortunately, the priorities at work shifted and I haven’t done much more with workflows since than.

The world, however, hasn’t stopped.  The tools and libraries that existed a year ago are still around and they got a lot better.  Additionally, there are a few new tools that help with workflows, state machines, and the like.

Today I came across a really useful and easy to use tool for building and executing workflows in PHP – pvm, aka PHP Process Virtual Machine.  It’s built and released as Open Source software under MIT license by the excellent guys at Forma-Pro.   If you are still looking for a tool to build and execute workflows, I strongly suggest you give PVM a try.  Given how complex the nature of the problem, this tool is probably the easiest to get started with.

The Rise Of The State Machines

The Rise Of The State Machines” is a nice introductory article into the domain of process management and state machines.

A state machine is a mathematical model of computation. It’s an abstract concept whereby the machine can have different states, but at a given time fulfills only one of them. There are different types of state machines. The most famous one, I believe, is the Turing machine. It is an infinite state machine, which means that it can have a countless number of states. The Turing machine does not fit well in today’s UI development because in most cases we have a finite number of states. This is why finite state machines, such as Mealyand Moore, make more sense.

The difference between them is that the Moore machine changes its state based only on its previous state. Unfortunately, we have a lot of external factors, such as user interactions and network processes, which means that the Moore machine is not good enough for us either. What we are looking for is the Mealy machine. It has an initial state and then transitions to new states based on input and its current state.

There are quite a few JavaScript code examples and library references, illustrating the basic concepts and implementation.

formapro/pvm – PHP library for building workflows and business processes

formapro/pvm is a PHP library for building workflows and business processes.  This is a nice addition to alternatives that I’ve looked at in “Getting started with workflows in PHP“.  The library is brought to you by Forma Pro, the same guys who are behind the php-enqueue enterprise queuing solution in PHP.

Huginn integration platform

Huginn is an integration platform that manages triggered events with agent services according to workflows.  Unlike many hosted services (Zapier, IFTTT, bip.io), Huginn is an Open Source application written in Ruby on Rails, and can be hosted, extended, and customized locally.

If you can read Russian, make sure to check out this post that shows some example use case scenarios.

Getting started with workflows in PHP

For a large project at work, we need to integrate or develop a workflow engine.  I worked a little bit with workflow engines in the past, but the subject is way to big and complex for me to claim any expertise in it.

So, I am looking at what’s available these days and what are our options.  This post is a collection of initial links and thoughts, and it’s goal is mostly to document my research process and findings, and not to provide any answers or solutions yet.

Continue reading “Getting started with workflows in PHP”