Module OpenWFE::WorkItemListener
In: lib/openwfe/listeners/listener.rb

this mixin module provides two protected methods, handle_item() and filter_item(). They can be easily overriden to add some special behaviours.

Methods

Included Modules

Contextual Logging OwfeServiceLocator

Protected Instance methods

The base implementation is just empty, feel free to override it if you need to filter workitems.

One example :

    class MyListener
        include WorkItemListener

        protected

            #
            # MyListener doesn't accept launchitems
            #
            def filter_items (item)
                raise "launchitems not allowed"              #                     if item.is_a?(OpenWFE::LaunchItem)
            end
    end

[Source]

    # File lib/openwfe/listeners/listener.rb, line 88
88:             def filter_items (item)
89: 
90:                 #raise(
91:                 #    "listener of class '#{self.class.name}' "+
92:                 #    "doesn't accept launchitems")
93:             end

Simply considers the object as a workitem and feeds it to the engine.

[Source]

    # File lib/openwfe/listeners/listener.rb, line 61
61:             def handle_item (item)
62: 
63:                 filter_items item
64: 
65:                 get_engine.reply item
66:             end

[Validate]