Skip to content

Instantly share code, notes, and snippets.

@anb
Forked from anonymous/anb.rb
Created January 4, 2012 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anb/1559151 to your computer and use it in GitHub Desktop.
Save anb/1559151 to your computer and use it in GitHub Desktop.
class AnbParticipant < Ruote::StorageParticipant
def consume(workitem)
if workitem.params['nonblock']
do_something
reply_to_engine(workitem)
else
super(workitem)
end
end
end
@anb
Copy link
Author

anb commented Jan 4, 2012

class TaskParticipant < Ruote::StorageParticipant

    def consume(workitem)

      doc = workitem.to_h

      doc.merge!(
        'type' => 'workitems',
        '_id' => to_id(doc['fei']),
        'participant_name' => doc['participant_name'],
        'wfid' => doc['fei']['wfid'])

        doc['store_name'] = @store_name if @store_name

        if workitem.lookup('params.options.continue_process')
            reply_to_engine(workitem)
        else
            @context.storage.put(doc)
        end

    end

end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment