about processes and engines

ruby process definitions

(update : this page uses the ‘def make’ trick, for simpler Ruby business process definitions, see this page on OpenWFEru’s website directly)

OpenWFEru is a port of OpenWFE from Java to Ruby. Hence it reads XML process definitions like that one :

<process-definition name="test" revision="0">
        <set field="amount" value="100CHF" />
        <participant ref="b" />

There was a small discussion about defining processes in yaml (which we currently uses for process persistence).

But maybe there’s something even simpler.

We’ve just added a way to define process definitions for OpenWFEru as Ruby classes :

class TestDefinition1  
  def make
    process_definition :name => "test", :revision => "0" do
       sequence do
          set :variable => "amount", :value => "100CHF"
          participant :ref => "a"

Advantages :

* Ruby IDEs (there are some maturing) can be used to edit the processes.

* For some people (especially developers), it’s more readable than XML process definitions.

* A Ruby process definition class is more like a ‘process definition generator’, it could generate a process definition each time different (depending on certain factors that can be embedded within the definition class)

This implementation is not yet fully ready, for instance, there are collisions between OpenWFE expressions like “if” and Ruby’s own “if”, but there are solutions.

Stay tuned.

Written by John Mettraux

January 14, 2007 at 2:16 pm

Posted in openwfe, openwferu, ruby

%d bloggers like this: