Ruote in 20 Minutes

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    5 Favorites

    Ruote in 20 Minutes - Presentation Transcript

    1. ruote - open source ruby workflow and bpm engine Developed by John Mettraux jmettraux.wordpress.com Presented by Kenneth Kalmer in 20 minutes opensourcery.co.za
    2. Workflows? BPM?
      • “Improved state machine”
      • Long running processes, long-lived process interpreter
      • Diverse participants
      • Complex rules & decisions
      • Implement clearly defined business processes
    3. Joe's Mortgages
      • Applies on your behalf at seven different institutions
      • Selects the best deal for you
      • Handles application for you
      • You sign
      • You buy
      • You pay
    4. State Machine
      • :requested
      • :evaluation
      • :acquired
      • :accepted
      • :applied
      • :approved
      • Where?
      • When?
      • Rate?
      • Comparison?
      • Who?
    5. Rule: Notify Client when 4 quotes are received aasm_state :pending_four_left aasm_state :pending_three_left aasm_state :pending_two_left aasm_state :pending_one_left aasm_state :pending_but_notified_client ... aasm_state :is_this_ridiculous_or_what?
    6. Rule: Wait up to 7 days for quotes aasm_state :pending_four_remaining_timeout aasm_state :pending_three_remaining_timout aasm_state :pending_two_remaining_timout aasm_state :pending_one_remaining_timout … aasm_state :call_recruiter_for_new_dev!
    7. Recap
      • State machines are only valuable when they have a few, well defined states
      • Tempted to setup hundreds of states, with complex transitions
      • State machines help manage the results of real life processes, not the processes
    8. Modified State Machine class Mortgage aasm_initial_state :pending aasm_state :pending aasm_state :quoted aasm_state :applied aasm_state :approved aasm_state :rejected end
    9. Enter ruote
      • Clearly defined DSL for workflow
      • Clearly defined processes
        • Expressions
        • Participants
      • Concurrent tasks
      • Timeouts
      • Easy decision making
    10. Expressions
      • Utility statements that give structure to your processes
      • Conditional statements that facilitate branching and merging patterns
    11. Participants
      • A point in the process where work gets done
      • Can be automated code
      • Can be human interaction
      • Ruote provides plenty of participants out the box
      • Breeze to write new ones
    12. First round: Participants class MortgageApplication < OpenWFE::ProcessDefinition sequence do institution_1 :activity => 'Mortgage Quote' institution_2 :activity => 'Mortgage Quote' institution_3 :activity => 'Mortgage Quote' institution_4 :activity => 'Mortgage Quote' institution_5 :activity => 'Mortgage Quote' institution_6 :activity => 'Mortgage Quote' institution_7 :activity => 'Mortgage Quote' end end
    13. Problems so far
      • Will request quotations in serial
      • 14 days to complete if each institution takes 2 days on average
    14. Concurrency!
      • Not the Erlang kind, the business kind
      • Send all requests in one go, and continue the process once we've received at least 4 quotes
      • Also, quote process may not take longer than 7 days to complete
    15. Second round: Concurrency and Timeout class MortgageApplication < OpenWFE::ProcessDefinition sequence do timeout :after => '7d' do concurrence :count => 4 do institution_1 :activity => 'Mortgage Quote' institution_2 :activity => 'Mortgage Quote' institution_3 :activity => 'Mortgage Quote' institution_4 :activity => 'Mortgage Quote' institution_5 :activity => 'Mortgage Quote' institution_6 :activity => 'Mortgage Quote' institution_7 :activity => 'Mortgage Quote' e nd end end end
    16. Achievements so far
      • Quotations requested simultaneously
      • Process will take 7 days at most to complete
      • First 4 institutions stand the chance of earning new business
      • Mortgage is still “pending”
    17. Rule: Joe can re-request quotes
      • Joe drives a hard bargain
      • Can request quotes any number of times
      • But, wants to let the client know he's doing his best!
    18. Third round: Bargain hard class MortgageApplication < OpenWFE::ProcessDefinition sequence do loop do concurrence :timeout => '7d', :count => 4 do institution_1 :activity => 'Mortgage Quote' # ... e nd joe :activity => 'Review quotes' _break :if => “${f:joe_happy}” email :activity => “Getting new quotes”, :to => “${f:client.email}” end end end
    19. Achievements so far
      • Loop used to keep the quote request process running until Joe is happy, or cancels the process
      • Client notified everytime the quote request process starts all over again
      • First glimpse of workitems
      • Mortgage is still “pending”
    20. Workitems?
      • The internal “message” passed from participant to participant
      • They're JSON friendly Ruby hashes
      • Participants can modify workitems
      • Processes can be launched with an initial payload, client details in this case, which is accessed through the workitems
      • Workitem attributes accessed in process definitions through the “dollar notation”
    21. Quote found, action the client class MortgageApplication < OpenWFE::ProcessDefinition sequence do loop do # ... end secretary :activity => “Send client application forms” end end
    22. Application received, apply at institution class MortgageApplication < OpenWFE::ProcessDefinition sequence do # ... secretary :activity => “Send client application forms” participant :ref => “${f:selected_institution}”, :activity => “Apply for mortgage” end end
    23. Achievements so far
      • Dynamic participant specification from workitem attributes
      • Another human participant
      • Mortgage now in “applied” state
    24. Let Joe Know
      • Joe reviews the results of the application, and notifies the client
      • Might attempt to restart the entire process
    25. Joe has last say class MortgageApplication < OpenWFE::ProcessDefinition sequence do # ... participant :ref => “${f:selected_institution}”, :activity => “Apply for mortgage” joe :activity => “Review application results” end end
    26. What happens here?
      • Joe will inform the client of the institutions response
      • Mortgage will stay in “applied” state, or move to “approved”/”rejected” states
      • Process ends
    27. Possibilities from here
      • Automated decision making
        • Decision tables
        • Better conditional tests
      • Automated response processing, streamlines the feedback loop and decision making
      • Harass institutions that don't respond within 2 days of process timeout
      • Joe improves his handicap
    28. Ruote & AASM
      • Great combination
      • Ruote handles business logic, AASM the state
      • AASM becomes skinny, ruote stays declarative
    29. More ruote: Listeners
      • Start process, or wait for
        • Messages from SQS
        • Jabber messages
        • Atom feed entries
    30. More ruote: Cancel, cursors, replay & redo
      • When processes are cancelled, run sub-processes for “cleanup” tasks
      • Replay failed steps
      • Redo steps based on conditions
      • Jump to any point in the workflow using cursors
    31. More ruote: ruote-fluo
      • Graphical representation of process definitions
      • Edit process definitions on the fly
    32. More ruote: Active*Participants
      • ActiveRecordParticipant
        • Save workitem information in database
      • ActiveResourceParticipant
        • Interact with any Rails resource as DHH intended you to do
    33. Shameless Self Promotion
      • Developed the JabberParticipant and JabberListener now bundled with ruote
      • Added support for daemonizing ruote-rest
      • In talks on refactoring ruote-rest to become preferred “Rails-friendly” implementation of ruote
    34. Summary
      • Process definitions built up from expressions
      • Expressions are “steps in the workflow”
      • Participants perform explicit function during workflow
      • Workitems used as “internal messaging” mechanism between expressions/participants
      • The best complement to any state machine implementation
      • Simplifies complex business process implementations
      • You have full control over the entire process
    35. Thank You opensourcery.co.za @kennethkalmer openwferu.rubyforge.org #ruote on Freenode groups.google.com/group/openwferu-users @jmettraux
    SlideShare Zeitgeist 2009

    + Kenneth KalmerKenneth Kalmer Nominate

    custom

    3188 views, 5 favs, 4 embeds more stats

    A quick introduction to the Ruote workflow and BPM more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 3188
      • 1431 on SlideShare
      • 1757 from embeds
    • Comments 0
    • Favorites 5
    • Downloads 77
    Most viewed embeds
    • 1630 views on http://www.opensourcery.co.za
    • 125 views on http://ruote.rubyforge.org
    • 1 views on http://localhost:4331
    • 1 views on http://translate.googleusercontent.com

    more

    All embeds
    • 1630 views on http://www.opensourcery.co.za
    • 125 views on http://ruote.rubyforge.org
    • 1 views on http://localhost:4331
    • 1 views on http://translate.googleusercontent.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories