56
ruote 2.0 2009/10/07

towards ruote 2.0

Embed Size (px)

DESCRIPTION

Initial presentation of Ruote 2.0. Those slides were presented by Nando Sola during the first "Ruedas y Cerverzas" meeting in Abstra.cc Madrid office on 2009-10-08. The first part enumerates reasons for the move to 2.0 while the second details the enhancement made to the ruote process definition language.

Citation preview

Page 1: towards ruote 2.0

ruote 2.0

2009/10/07

Page 2: towards ruote 2.0

warning :

these slides pre-suppose you have some familiarity

with ruote (0.9.x)

Page 3: towards ruote 2.0

‣ recap : ruote‣ is a ruby workflow engine‣ ruby makes it easy to tinker and try‣ workflows should be easy to tinker

and try‣ with some discipline, you might

even end up doing BPM with it

Page 4: towards ruote 2.0

agenda

Page 5: towards ruote 2.0

agenda

Page 6: towards ruote 2.0
Page 7: towards ruote 2.0

ruote 2.0 engine

Page 8: towards ruote 2.0

‣ ruote engine : historically‣ middleware/backend-ish‣ not for your big front web 2.0 app‣ cheap workflow engine‣ 1 engine per business unit

Page 9: towards ruote 2.0

‣ ruote engine : core requirements‣ has to run multiple processes‣ with multiple branches‣ and/or subprocesses

‣ can be stopped / restarted(if running with persistent storage)

‣ can run multiple versions of any process

‣ has to allow in-flight modifications to processes

Page 10: towards ruote 2.0

‣ ruote 2.0 engine‣ multi ruby process resilient :(‣ complete rewrite

with a cleaner interface

Page 11: towards ruote 2.0

‣ multi-process‣ the average user wants to put ruote

in his rails app‣ the rails app is

in a ‘multi-process’ ruby web server‣ ruote 0.9 is

in trouble...

Page 12: towards ruote 2.0

‣ multi-process resilience‣ ruote 2.0 knows it could run in a

multi-process env‣ it has defense mechanisms

things like ‘tickets’ and ‘locks’‣ they have a cost :-(

‣ suggestions‣ avoid mp envs for ruote

(the engine is idle most of the time)‣ run ruote as a webservice

in a 1p env‣ (ruote in 1p can use “caching”

and be faster)

Page 13: towards ruote 2.0

‣ our favourite env these days‣ ruote-{kit|http}

workflow as an http service‣ ruote-amqp‣ remote participants

as amqp (daemons)http://github.com/kennethkalmer/daemon-kit

‣ load on ruote itself is low

Page 14: towards ruote 2.0

‣ anyway...‣ 1 engine that scale

for everything ?‣ why not 1 engine

per domain / unit ?‣ why not a separation between

tactical and technical engines ?‣ why not engines that talk to each

other ?‣ scale the business

or scale the tools ?

Page 15: towards ruote 2.0

‣ engine workqueue‣ where each operation is performed‣ only 1 op at a time‣ by default, uses Thread/Queue‣ uses EventMachine if present‣ future work :‣ fibers ?‣ it’s an implementation away

‣ anyway, engine is idle most of the time (usually waiting for those slow humans)

Page 16: towards ruote 2.0

cleaner interface

Page 17: towards ruote 2.0

cleaner interface

Page 18: towards ruote 2.0
Page 19: towards ruote 2.0

ruote 2.0 process definitions

Page 20: towards ruote 2.0

‣ AST is JSON friendly‣ attributes common to all expressions‣ :if / :unless‣ :timeout, :on_timeout‣ :on_cancel / :on_error‣ :forget

‣ directed commands‣ break :ref => ‘tag’

‣ jump :to => ‘tag’‣ concurrent_iterator enhancements‣ subprocesses and apply‣ ...

Page 21: towards ruote 2.0

AST is JSON friendly

Page 22: towards ruote 2.0

XML is still here

Page 23: towards ruote 2.0

‣ common attributes‣ can be given to any expression

Page 24: towards ruote 2.0

:if / :unless

Page 25: towards ruote 2.0

:timeout

Page 26: towards ruote 2.0

:on_timeout

Page 27: towards ruote 2.0

‣ :on_error‣ much like begin / rescue...‣ occurs when error is triggered‣ error is thus not logged in

error_journal

Page 28: towards ruote 2.0

:on_error

Page 29: towards ruote 2.0

:on_error

Page 30: towards ruote 2.0

‣ :on_cancel‣ subprocess or participant

triggered when expression gets cancelled

‣ unlike :on_errortrigger happens when cancel is complete

Page 31: towards ruote 2.0

:on_cancel

Page 32: towards ruote 2.0

:forget

Page 33: towards ruote 2.0

‣ cursor / jump‣ can now jump to

a tag, a participant name ora subprocess name

‣ almost that‘cursors as state machines’feeling

‣ works with repeat (loop)as well

Page 34: towards ruote 2.0

cursor / jump

Page 35: towards ruote 2.0

‣ directed commands‣ cursor/repeat has

jump/rewind/break/... commands‣ until now these commands were

only meant for the enclosing cursor/repeat

‣ now with :tag and :ref, more precision is possible

‣ works with the iterator expression as well

Page 36: towards ruote 2.0

rewind :ref => ‘tag’

Page 37: towards ruote 2.0

skip :ref => ‘tag’

Page 38: towards ruote 2.0

‣ concurrent_iterator‣ :times / :branches‣ add_branches partner expression

Page 39: towards ruote 2.0

concurrent_iterator

Page 40: towards ruote 2.0

concurrent_iterator

Page 41: towards ruote 2.0

‣ ruote 0.9.x had the ‘eval’ expression‣ evaluating segments of process

‣ ruote 2.0 has ‘apply’‣ same mission‣ and more (yield)

Page 42: towards ruote 2.0

vanilla apply

Page 43: towards ruote 2.0

yield like apply

Page 44: towards ruote 2.0

set ‘v:x’ => ‘y’

Page 45: towards ruote 2.0

‣ engine variables‣ can be read from processes‣ cannot be set from processes‣ are thus on the same foot as

participants(which are registered at the engine level)

Page 46: towards ruote 2.0

engine vars

Page 47: towards ruote 2.0

engine vars

Page 48: towards ruote 2.0

‣ more aboutprocess definitions and expressions

http://ruote.rubyforge.org/expressions.html

http://ruote.rubyforge.org/patterns.html

Page 49: towards ruote 2.0
Page 50: towards ruote 2.0

2.0 projects

Page 51: towards ruote 2.0

‣ ruote-dmdatamapper persistence

http://github.com/jmettraux/ruote-dm

‣ ruote-aractiverecord persistence

http://github.com/kennethkalmer/ruote-activerecord

‣ ruote-couch (coming soon)couchdb persistence

http://github.com/kennethkalmer/ruote-couch

Page 52: towards ruote 2.0

‣ ruote-kitfull blown ruote-rest evolution

http://github.com/kennethkalmer/ruote-kit

‣ ruote-httptiny sinatra ruote webservice

http://github.com/jmettraux/ruote-http

Page 53: towards ruote 2.0

‣ ruote-amqpamqp participants and listeners

http://github.com/kennethkalmer/ruote-amqp

‣ ruote-fluostill in the run

http://github.com/jmettraux/ruote-fluo

Page 54: towards ruote 2.0
Page 55: towards ruote 2.0

‣ ruote [2.0] website

http://ruote.rubyforge.org

‣ ruote mailing list

http://groups.google.com/group/openwferu-users

‣ freenode.net IRC

#ruote

Page 56: towards ruote 2.0

many thanksto everyone in the communityespecially to the “ruedas y cervezas” participants ;-)