This document discusses ruote, a pure Ruby workflow engine. It provides an operating system for business processes that uses a process definition language to define workflows. Processes can be linear, parallel, or nested. Process instances run in isolation and workitems are passed between participants, which can be human or autonomous. Ruote allows for complex workflows with conditional logic and callbacks. It sees use in a variety of domains including internet exchanges and scientific organizations.
9. Process instances
Processes run in isolation
The AST is stored in the engine
Original code used to launch the process can be altered
without affecting running processes
Processes can be versioned
10. Workitems
Set the initial “payload” when launching a process
Workitems are passed between participants
Participants can update workitems, or just read
Process flow can be altered by workitem values
12. Human participants
Persist the workitem
Load it from another application to present to a “human”,
which should take action
ruote-couch
ruote-dm
ruote-redis
and more...
13. Autonomous participants
Local participants
Instantiated classes that respond to #consume()
Remote participants
ruote-amqp & daemon-kit
Scatter your participants over different systems
14. Notes on participants
They are abstractions
They are stateless
Once the engine hands over a workitem to a participant,
it will wait indefinitely for a response (unless a timeout is
specified)
They rely on the workitem to know what is expected of
them
16. ruote-kit
RESTful wrapper around ruote
Rich environment for exploring, perfectly capable of
production use
Can be used as rack middleware (preferably not)
github.com/tosch/ruote-kit
17. In the wild
Internet Exchange / ISP in a Box
Huge number of processes running daily
Mostly autonomous, humans handle exceptions
Provisions dozens of services
Some processes involve a dozen participants, running all
over the globe and complete within 5 seconds :)
18. In the wild
Meego BOSS
Used to orchestrate the CI ecosystem for the OS
http://wiki.meego.com/BOSS
Started as a Java workflow, then came to the light :)\n
Probably the most important slide in this entire presentation\n
ruote is patient\nprocesses can run for years and years\n
All wrapped up in a “ready for distributed” package, scales out the box if configured correctly\n
Expressive DSL that results in an AST of sorts\nExpressions are “executed” by the engine\n
Opportunity for callbacks, loops, flow control, etc\n
Versioning is more of an attribute that admins use to determine what is going on\nJust like NoSQL schemas evolve, so do processes, and different versions can coexist\n
The means of communication between participants\nAkin to passing an ID of a row in a table between systems\nLoaded with rich meta-data that can be used by the participants (ruote-kit and timeouts)\n
Arrows show how the values of workitem fields can alter the process flow\n“rewind” expression show flow control\n“concurrence” shows parallel execution\n
The basic abstraction is that a “human participant” is a message in a inbox, somewhere\nUp to the application to read the workitem from storage and present it (and controls) to the users\n
Run in the same VM\nCan run in different VM’s on the same server\nCan be scattered throughout the globe\n
Only ever really a class\nDramatically simplified, think resque/dj\n
Each process runs in isolation, so if the file containing the definition changes, the process is unaffected...\n
I started it, Torsten picked it up and ran with it...\n