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”

Odnoklassniki.ru – the way to do site messages

After all the comments I received for my  other post about Odnoklassniki.ru, I decided to expand a little bit on the positive parts of the web site.  The biggest success of it, except of course for thousands of people registering spreading the word of a mouth, is the messaging system.  And the whole messaging system, but the notification part of it.

For me personally, the proof of the success of the notification system lies in the fact that I actually like it myself.  Because I am usually in the opposite camp.  I think that we have enough messaging and notification systems as we are, for web sites to develop their own ones.  But, in this case, I have to say that it was done very well, and that it works possibly better  than any other alternative could have.

If you are not familiar with it, here is a screenshot (NOTE: the green border on the left was added by me, I’ll explain why in a moment).

Odnoklassniki.ru profile

This is my profile page.  Or, more accurately, a part of it.  This is what I see when I login.  There is the main navigation menu at the top (orange color), with sub-menu (in light gray) for the currently selected tab.  There is my picture, and some basic information, such age, last login time, etc – something other users can see when they visit my profile.  And, there is the notifications section on the left side (I put the green border around it).

Users of Odnoklassniki.ru can send each other messages.  As far as I know, they can’t do mass mailings or group discussions or anything like that.  It’s purely one registered user to another.  There is a limit on the size of the message – 1,000 characters.  There is a rich text editor with some formatting controls, such as text alignment, foreground and background colors, copy and paste buttons, and font face and size selectors.  Of course, smiling images and some commonly used icons (money, beer, etc) are also available.

The nice parts of the notification system are as follows.  Firstly, it shows incoming messages and status notifications in full.  It doesn’t tell you something like “you have 1 new message, click here to read it”.  It just shows it you right there and then.  Secondly, it queues all notifications and messages and shows them to you in turn one by one.  Not all at once or in a digest form, but one by one, in chronological order.  Thirdly, the system doesn’t hide the message after it showed it to you.  And it does not insist on you dropping whatever is that what you were doing and acting upon the message.  No.  It keeps the message in its full length on the left side of your screen until you act upon it.  For this you have two buttons underneath the message – close it and reply to it.  If you close it, the next message appears if there is one, or the notification area folds, so that not to occupy your screen space with nothing.  If  you do a reply, then a popup window appears with the name and picture of the person to who you are writing the message, and a rich text editor.  You can type your message there and press submit button.  Once your reply is submitted, the popup window is closed and the notification for the message that you were replying to is closed.

The way this notification system works is totally intuitive and out of the user’s way.  There is no way one could miss the notification while browsing around.  And, at the some time, it is easy to ignore it if you are in the middle of something.  Considering that many users of Odnoklassniki.ru are middle aged people and older, with somewhat limited web experience, I think the system does them a big favor by not being too stealth or too aggressive.

Back to the wider system of messaging, there are a couple of other nice bits to it.

First of all, it’s the archives.  Message archives are easily accessible through the top menu.  You can go through incoming and outgoing messages separately. And again, there is always the name and image of the user with who you communicated, and the full text of the message right there – no need of extra clicks and deep navigation.

Secondly, the way email notifications are done is also nice.  The system is tracking if you are online or not.  If you are, it won’t be sending you email notifications.  And, if you are not, it will still give you a chance to come back before abusing your mailbox.  It does not send notifications right away as they happen, but keeps them in the queue for some time.  If you aren’t coming, you will eventually get those to your email.  But I have to say that the balance of immediate notifications without emergency email abuse hits right on.  Perfect.

Now, why am I so detailed and picky about this messaging and notification system of Odnoklassniki.ru?  Because, I believe that much of its popularity lies within just this part of the site.  Many of the registered users don’t know how to use other messaging systems (ICQ, Skype, IRC, etc).  Many don’t want to share their email address.  And many try to avoid any extra email.  Also, there is a large diversity in age, current location, and computer skills among the users, so finding another common medium for all these people to communicate might prove rather difficult.  But with this one, it’s not.  Anyone can send a message, get a message, and reply to a message.  And that’s all that matters.  I know some people who use Odnoklassniki.ru as an instant messenger.  They chat with a whole bunch of people at the same time, using really short messages of plain text (no rich formatting), and they send them back and forth a few times per minute.  These people stay online for hours at a time!

Can the existing system be improved?  Absolutely.  Firstly, I think it should use left-aligned or justified text whenever the text of the message is shown.  Now it uses centered text for some reason.  Secondly, I think formatting should be a little bit smarter.  Paragraphs and links should be recognized better.  Text *like this* should be bold.  Text _like this_ should be underlined.  There should be better support for quoting.  There should be a way to refresh your memory about older messages.  Maybe something like phpBB has.  Maybe group discussions will make some sense… Some of the possible improvements should be thought out and planned carefully not to make interface heavier or user interactions more complex.  But there are many potential improvements on the intuitive side of things – something that will minimize the annoyances and unexpected behaviors.

I’m eager to see how this part of the site will evolve in the future. What will be improved, what will be added, and what removed… What do you think?

How busy is your desktop?

Accidentally, I stumbled upon a thought provoking post with the following words:

If you’re really using your computer, your desktop should almost never be visible. Your screen should be covered with information, with whatever data you’re working on. I can’t imagine why you’d willingly stare at a static background image– or even a background image covered with a sea of icons. Unless you consider your computer a really expensive digital picture frame, I suppose.

Well said!

I haven’t thought much about this before, but suddenly I realized that I can strongly relate to the above statement.  My desktop is never visible.  And it was always a bit awkward for me to pick a background image (I know use slide show, which cycles through all images in my Pictures/ directory) or a set of icons (I have a few in the corners of my desktop, but I never click on them, cause I never see them) to place on my desktop.

I’m going to set it to a solid color right now.  And I’m going to remove the useless icons too.

What about your desktop?  Does it look something like this?

Firefox feature wishlist : tab groups

I wish Firefox (or any web browser for that matter) had a nice and easy way to group tabs together. If I could just move or copy tabs between groups, color them differently together or one by one, collapse and expand groups, search for tab, link tabs together (close one and linked one close together, move one and others will follow), etc.  Considering the amount of time it took for tabs to go mainstream, I am not sure I’ll live long enough to see a solution for grouping…

P.S.: Yes, I am aware of

  • grouping related tabs in several browser windows,
  • ColorfulTabs plugin for Firefox,
  • using bookmark groups to save tabs and open them later with one click,

but these aren’t solving my problems.  Not as they are now at least.