processi

about processes and engines

it’s barley a task manager

with 2 comments

In the comments of the previous post, Karl asked me about ruote : “how to resume execution of the workflow from a web application ?”.

Though Karl’s questions was more about receivers, I took the time to explore a sample ruote application.

Barley is a [for fun] task manager. It takes its name from the barely repeatable processes, of course, it can’t compare with the excellent Thingamy work processor.

Barley is a Sinatra web application wrapping a ruote workflow engine. Ruote can run many process instances issued from different process definitions, but barley’s processes are all instantiated from a single process definition.

The cursor expression does most of the work. It runs in sequence a ‘trace’ participant and a ‘next’ participant. Then if the field ‘next’ is set in the workitem (most likely it has been chosen by the ‘current’ participant), the cursor is rewound and the task ends up on the ‘next’ participant’s desk.

PDEF = Ruote.process_definition :name => 'barley' do
  cursor do
    trace
    participant '${f:next}'
    rewind :if => '${f:next}'
  end
end

If the ‘next’ field is empty, the cursor will be over, letting the process terminate.

Barley simply lets users push tasks around. There is no explicit “delegation”, “escalation” or whatever…

For the rest, look at the barley itself, it’s all in one single file, a workflow engine, two participants and the webservice, with the haml template at the bottom.

Torsten has deployed a demo instance at http://barley-plain.torstenschoenebaum.de/work. (he also has a version hooked to twitter auth).

You can install it and run it locally with :

  curl http://github.com/jmettraux/ruote/raw/ruote2.1/examples/barley.rb -o barley.rb
  gem install sinatra haml json ruote
  ruby barley.rb

Then head to http://127.0.0.1:4567/

P.S.

to remove ruote and its dependencies from your gems :

  gem uninstall ruote rufus-json rufus-cloche rufus-dollar rufus-lru rufus-mnemo rufus-scheduler rufus-treechecker

 

Written by John Mettraux

January 29, 2010 at 8:22 am

Posted in ruby, ruote, workflow

2 Responses

Subscribe to comments with RSS.

  1. Another demo instance running as Passenger: http://barley-plain.torstenschoenebaum.de/work

    Barley on Twitter: http://gist.github.com/289771
    ( Demo at http://barley.torstenschoenebaum.de/work )

    Thanks for the fun!

    Torsten

    January 29, 2010 at 4:50 pm

  2. [...] it’s barley a task manager « processi [...]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.