jmettraux / ruote

a ruby workflow engine (dead)
MIT License
496 stars 74 forks source link

Added support for on_pre_[action] methods to Ruote::ProcessObserver #89

Closed riverock closed 11 years ago

riverock commented 11 years ago

Hello,

I enhanced Ruote::ProcessObserver to support the ability for a subclass to define onpre[action] methods. My application has the need to do something just prior to a specific message being processed. I originally implemented an on_pre_msg method in my application's Ruote::ProcessObserver subclass, however I found that I had to duplicate all the code from Ruote::ProcessObserver#on_msg that sets up the wfid and info parameters. I felt that a better solution was for Ruote::ProcessObserver to implement an on_pre_msg, by having it share code with the existing on_msg method.

I also added a couple of tests for my changes to test/functional/ft_77_process_observer.rb, and then ran the full suite of tests to make sure they still pass (which they did).

Please consider accepting my pull request.

Thanks, Denis Ahearn

jmettraux commented 11 years ago

Hello,

@coffeeaddict, what do you think? ProcessObserver is your convenience.

For me it's OK. It makes sense. One could even go a step further and eliminate #on_msg and #on_pre_msg by making ProcessObserver inherit from Observer.

Waiting for Hartog's feedback. Thanks for the nice pull request.

John

coffeeaddict commented 11 years ago

:+1:

jmettraux commented 11 years ago

Many thanks!