about processes and engines

Archive for the ‘atom’ Category

new ruote quickstart

picture-11Ruote has a new website, like the one for Rufus, it’s based on the excellent Webby.

I wrote yesterday about renovating the quickstart, I had initially written an example showing a mini todo tool, but this time I switched to a “mechanical turk” like example where a process instance fetches flickr pictures and presents them to human participants for evaluation and choice.

The process definition boils down to :

class PicSelectionProcess < OpenWFE::ProcessDefinition

  sequence do


    concurrence :merge_type => 'mix' do

      # display the pictures chosen by the users

the participant for fetching the pictures is called ‘get_pictures’ :

engine.register_participant :get_pictures do |workitem|

feed =”+
feed.update! = feed.entries.inject([]) do |a, entry|
a << [ entry.title,, entry.links.first.href ] end end [/sourcecode] That's it for the quickstart. Now I have to update the tea tasting team example and the japanese website.

Written by John Mettraux

December 16, 2008 at 6:57 am

Posted in atom, bpm, openwferu, ruby, ruote, workflow

pilatus for yahoo pipes

picture-1I just updated the activity page for Ruote (warning it needs some CSS love). It’s populated with the result of a Yahoo Pipe that gathers the feeds of Ruote’s activity, be it on github, the users mailing list or this blog.

It all happens on the client side. I’ve written a small javascript library called Pilatus to which you give the URL of a pipe and the id of the HTML div element to fill and that’s all.

  <script src='/pilatus.js'><script>

  <div id='feed'></div>


Nothing special. License is MIT, washing my hands.

the js :
the project :

Written by John Mettraux

December 5, 2008 at 2:06 am

something about gcal

I had a request for creating events in Google Calendar from some business processes. It gave me the opportunity to play with Google Data; it wasn’t too difficult, especially since it’s based on Atom and AtomPub.

I have thus started working on a new rufus library. It’s very limited for now, but I can have code that looks like that :

require 'rubygems'
require 'rufus/gcal'

calendars = Rufus::Google::Calendar.get_calendars(
  :account => ENV['GUSER'],
  :password => ENV['GPASS'])

#calendars.values.each { |c| p [, c.href ] }

cal = calendars['gwork']

id = cal.post_quick!(
  'Tennis with John November 13 3pm-4:30pm') => 'tennis').each do |e|
  puts e.to_s

Behind the scenes, it relies heavily on the fine atom-tools gem by Brendan Taylor.

The only authentication mechanism used is the ClientLogin. For the other mechanisms, one can look at gdata-ruby.

My next step will be to polish the Event class and to allow for manipulation of Calendar resources. Then I will take a look at other Google Data APIs.

source :
mailing-list :

Written by John Mettraux

November 13, 2008 at 12:07 am

Posted in atom, atompub, google, ruby, workflow

restful workflow engine

update : the work announced here has been renamed “ruote-kit”, you can find it at

I’ve been working on this vaporous thing / project for a while, now it’s here, in its first iteration. It’s called Kisha (steam train).

The short designation is “RESTful workflow engine”, the long one is “RESTful Rails® enveloppe for an OpenWFEru engine [and a worklist]”.

Kisha is leveraging Ruby on Rails 2.0.2 to present a RESTful interface to the OpenWFEru workflow engine.

This first iteration implements 2 core use cases via 2 resources.

The use cases are :

  • launching a new instance of a process
  • editing and then proceeding/saving a workitem

quick wiki quote :

A business process or business method is a collection of interrelated tasks, which solve a particular issue

The 2 resources are “processes” and “workitems”. Thus, RESTfully yours, these paths are available :

  • /processes the list of processes currently running in the workflow engine
  • /processes/{process_instance_id} accessing a particular process instance
  • /workitems all the workitems awaiting manipulation/proceeding from an external participant (you)
  • /workitems/{workitem_id} a particular workitem

Launching a process is done by POSTing a process/launchitem representation to /processes, while modifying/proceeding a workitem is by PUTting an updated representation of that workitem at /workitems/{workitem_id}.

(there is a working draft enumerating those resources at kisha.txt)

That’s for the theory.

Kisha is available in its first iteration as a zip download or via the source (see this piece of documentation).

For documentation and test purposes, I took care of providing a well-connected set of HTML representations of the resources, here are a few screenshots :

Kisha screenshot

What’s in this first iteration :

  • well connected HTML representations (learn the interface by playing around)
  • Rails ActiveResource JSON and XML representations
  • Atom representations as well
  • Possibility to post resources (/processes for now) via AtomPub
  • limited Authentication scheme ( is trusted as well as the canonical “user” user, via basic http authentication)
  • binary Authorization (once you’re authentified, you can do everything)
  • a chart representation for workitems and processes (it’s taken out of densha)
  • a plain model for participants : there is one ‘catch-all’ participant (an expressions with a typo could be mistaken for a participant)

I’ve tried hard to accept a large set of variants for the process/workitem input (json, xml, yaml, atom entries, …), Kisha should be able to accomodate them all, this has proven the most time consuming aspect for now.

What will be in further iterations :

  • more authentication schemes (Pat is petitioning me about them)
  • a better authorization system (who can launch, who can proceed, who can pause)
  • more resources (process errors, process variables, maybe process definitions, …)
  • why not a /participants resource ?
  • more efficient usage of the resources (etag & co)
  • polishing the AtomPub interactions
  • activity [atom] feed
  • more documentation

Over for now.

Feedback is welcome on the OpenWFEru mailing lists.

Written by John Mettraux

December 20, 2007 at 5:52 am

Rest and AtomPub for Rufus

Mark Masterson just posted about RESTafarian Workflow / BPM Ganja, here are my two favourite quotes :

I’m gnawing on the beginnings of the idea that we might be able to implement an entire BPMS on top of a RESTful infrastructure

I’m beginning to suspect that embracing the various aspects of REST might allow us to build the “next generation” of process management systems.

This is great to read, and I’m quite happy that OpenWFEru is just in the middle of that. I hope Mark will post more about his ideas, maybe one day, OpenWFEru could be useful for him.

The old OpenWFE (the java one) featured a RESTlike interface and I was surprised to find out a year ago that the FormsPlayer people were using it, directly from the browser for some of their customers.

The first RESTful business process engine that I know of is the GeoBPMS of Pat Cappelaere, there is OpenWFEru behind it and Pat was always evangelizing to me the need for a RESTful OpenWFEru (with AtomPub for posting resources).

Matt Zukowski, in parallel, was working on Fluxr, a RESTful envelope around OpenWFEru, but unfortunately, he cannot continue the development.

That’s it for the context, so why the title “Rest and AtomPub for Rufus” ?

Rufus is the nickname of OpenWFEru, please use it when you feel that OpenWFEru is too hard to pronounce.

I’ve just implemented a new AtomPubParticipant for Rufus. It posts its workitems to an AtomPub enabled resource.

include OpenWFE::Extras

target_uri = \

params = {
  :username => "x",
  :password => "y",
  :categories => "test, workflow"

  "app",, params))

This example posts to a [dump] wordpress account. By default, it dumps the workitem as YAML, but it’s easy to override or monkey patch the methods of the AtomPubParticipant to have it use other formats.

So why brag about it ?

  • it’s easy to build a publication workflow based upon OpenWFEru and a blog engine like WordPress
  • a blog can be used for holding business activity trace/history

which are just sub-cases of :

  • in a RESTful environment, you can create resources via AtomPub inside of an OpenWFEru driven business process

Next step for me will be the implementation of a BlogParticipant for posting human oriented entries (no big work, it’s just an extension of the class AtomPubParticipant).

And the step after that is quite obvious : reverse the vapor, and expose the OpenWFEru resources for creation and modification via AtomPub.
It has already begun with exposing the activity of the engine, as a feed (rather read-only).

Mark will certainly be better than me at explaining the benefits of such a business process management system.

Written by John Mettraux

November 13, 2007 at 5:58 am

an atom feed for process engine activity

The next release of OpenWFEru’s Densha will feature an atom activity feed.

It’s already available in the trunk and at

to track only the activity for the salesteam participant :

to track only replies of that team (when tasks/workitems come back to the process engine) :

and so on…

Next releases of this activity feed will require authentication, an open viewpoint on all the business process activity is something process admins don’t usually want, too enterprise 2.0 maybe.

Written by John Mettraux

November 11, 2007 at 1:37 pm

posting to wordpress via ruby and atompub

The ruby script here uploads posts to WordPress blogs via AtomPub.

Once you’ve set your blog coordinates in the script (around line 20), you can post like that :

echo "I love Ruby" | post.rb -t "title" -c "thoughts,ruby"

The script will publish your post and then ouptput the WordPress server reply.

#!/usr/bin/env ruby

# Copyright (c) 2007 John Mettraux
# Released under the MIT license

require 'optparse'
require 'net/http'

require 'rubygems'
require 'atom/entry' # sudo gem install atom-tools
require 'atom/collection'

    # a great thanks to the devs of all the libs used here

# some info about you and your blog

blog = "yourblog"
authorname = "Your Name"
username = "x"
password = "y"

bloguri = "http://#{blog}"
base = "https://#{blog}"

# parse options

tags = []
title = nil
type = 'html'

opts =
opts.banner = "Usage: post.rb [options]"
opts.separator ""
opts.separator "options :"

    "--categories {list}", 
    "comma separated list of tags/categories") do |v|

    tags = v.split ","

    "--title {title}", 
    "title for the post") do |v|

    title = v

    "--type {html|xhtml|text}", 
    "type of the content. ('html' is the default).") do |v|

    type = v

    "displays this help") do

    puts opts.to_s
    exit 0

opts.parse ARGV

raise "please specify a title for the post with the -t option" \
    unless title

# gather content

content = ""
loop do
    line = STDIN.gets
    break unless line
    content += line

# create entry

entry =
entry.title = title
#entry.updated =

author = = authorname
author.uri = bloguri
entry.authors << author

tags.each do |t|
    c =
    c["scheme"] = bloguri
    c["term"] = t.strip
    entry.categories << c

entry.content = content
entry.content["type"] = type if type

#puts entry.to_s

h =
h.user = username
h.pass = password
h.always_auth = :basic

c = + "/posts", h)
res =! entry

puts res.read_body

Next step for me, integration of the technique into ruote.

Updated 2007/11/11 : following the suggestions of Brendan Taylor, the author of atom-tools, I simplified the scripts, now relying on atom-tools for posting the entry.


Written by John Mettraux

November 5, 2007 at 1:25 am

Posted in atom, atompub, rest, ruby, wordpress