Consolidated older post - originally posted in Sep, 2010
I've been meaning to write a workflow engine/language for sometime and recently, some scala DSL discussions gave me the motive. I know there's tons of workflow products but none complete and to my liking.
I started in May, worked on it a few hours here and there, for a few weeks and then didn't find the time to complete, so this is still work-in-progress, a snail-pace kind of progress. Since the basic ideas are in place, I figured it's worth advertising, maybe attract some converts and start a religion!
The project is over at http://github.com/razie/gremlins
This is not really meant to be a full-blown BPEL or BPMN environment, but a tiny, extensible but sweet and easily embedable workflow framework, that one can use to automate things inside the house, study the behavior of certain grains of sand or write more readable and interactive complex algorithms.
There's more details in the vision page http://github.com/razie/gremlins/blob/master/Gremlins.markdown, but these are the basic principles behind this project:
Since these are all plain graphs, certain graph transformations should be able to turn a state machine into a workflow or a PI into a BPEL or whatever you want into something you'd like...
So far, 1-4 are prototyped and 5-8 are "in progress": a basic concurrent engine and DSL are in place... I didn't get to the distributed part yet.
The magic of a scala DSL makes this simple CSP style workflow possible:
v(c) (c ? P | c ! Q)
Doesn't look like scala code? Well... it is and it's proof of why scala is scalable! Of course, this comes with one of those "don't do this at home" annotations.
More complex examples include a scala version:
import razie.wfs._
val workflow = wfs strict seq {
par {
seq {
println ("he he - definition time")
later { _ + "runtime-a" }
}
later { _ + "runtime-b" }
}
sort[String] (_ < _)
matchLater { case x : List[String] => x mkString "," }
}
or a text version:
def wpar6 = """
par {
seq {
inc
log($0)
}
seq {
inc
log($0)
}
}"""
If you'd like to stay up-to-date, follow me on http://twitter.com/coolscala - among boring tweets of mine or interesting re-tweets of others, you may find some updates on my projects.
Enjoy!