about processes and engines

workflow instance id

Each time the OpenWFE engine interprets a process definition and launches a process instance (workflow instance), it attributes a brand new and unique (locally) workflow instance id (to make it unique in space, other info are included beyond this workflow instance id, such as the engine id and the process definition name and revision).

Up until now, OpenWFE and OpenWFEru were both relying on a simple clock based mechanism for generating integer ids, vulnerable to ‘clock back’ issues.

In the past, I’ve had to deal with broken processes where we had to roam through a large number of processes all designated by their integer (long) workflow instance id. As I wanted to make it easier to grasp instance ids, I implemented Kotoba.

The KotobaWfidGenerator which uses the Kotoba library is now the default OpenWFEru wfid generator. It produces ids like 20070322-bobupogigu, 20070322-bodahegowa or 20070322-bodatewari.

If you don’t like it, you can override this ‘default’, the old integer wfid style is still available and I have added a UUID based wfid generator for the purists.

require 'openwfe/engine/file_persisted_engine'

class MyEngine < OpenWFE::FilePersistedEngine
    def build_wfid_generator
        init_service(S_WFID_GENERATOR, UuidWfidGenerator)

engine =


This current UuidWfidGenerator uses any underlying “uuidgen” unix command and tries to enforce time-based UUIDs and not random-based ones. I’ll certainly soon add a workflow instance id generator based on a pure Ruby generator. My favourite for now is the one found within the reliable messaging project.

This new generator system will be available in the 0.9.7 OpenWFEru release. The generators in this system have been tightened against “back clock” issues.

Written by John Mettraux

March 22, 2007 at 2:25 am

%d bloggers like this: