Hello,

last week Hartog and I had a long conversation about process observers in a
pull request and via IRC:

  https://github.com/jmettraux/ruote/pull/54
  http://ruote-irclogs.s3.amazonaws.com/log_2012-07-27.html

We reached a consensus: he's going to propose an easy process observer that'd
look like:

  class SugarCoatedProcessObserver

    def on_launch(wfid, pdef, fields, variables)
    end

    def on_terminate(wfid, workitem)
    end

    def on_dispatch(workitem)
    end

    def on_receive(workitem)
    end

    # etc...
  end

Behind the scene I think we still need a raw process observer like:

  class ProcessObserver

    def on_msg(msg)

      target = "on_msg_#{msg['action']}"
      return unless self.respond_to?(target)
      send(target, msg)
    end
  end

  class MyProcessObserver < ProcessObserver

    def on_msg_terminate(msg)
      # ...
    end
  end

Note that the engine on_error and co, already are available process
observers, albeit specialized:

  http://ruote.rubyforge.org/configuration.html#engine_on

Speaking of observers, I just pushed a commit where the notification order is
determined by the alphabetical order of the observer service names:

  
https://github.com/jmettraux/ruote/commit/f72c2883e7acb19d70fe18dc75b0a261e1b4901a

That should help when process observers gain visibility.


Best regards,

--
John Mettraux - http://lambda.io/jmettraux

-- 
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en

Reply via email to