Class | Ruote::Observer |
In: |
lib/ruote/observer.rb
|
Parent: | Object |
An abstract class for observing the activity of a ruote engine.
Subclass it and add it as a service to observe certain events.
require 'ruote/observer' class MyLaunchObserver < Ruote::Observer def on_msg_launch(msg) puts "just launched process instance #{msg['wfid']}" end end dashboard.add_service('launch_observer', MyLaunchObserver) # ...
Simply add a "on_msg_<msg_name>" method for it to intercept the given messages.
See Ruote::ProcessObserver for a base class with precisely defined methods with helpful arguments if you don‘t want to investigate "msgs" too much.