Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class BaseParticipant
- include Ruote::LocalParticipant
- def initialize(opts)
- @opts = []
- end
- def validate(workitem)
- (@opts[:present] || []).each { |field_name|
- raise ArgumentError.new(
- "missing field '#{field_name}'"
- ) if workitem.fields[field_name].nil?
- }
- end
- def consume(workitem)
- validate(workitem)
- do_consume(workitem)
- end
- end
- class FinalParticipant < BaseParticipant
- def do_consume(workitem)
- # do the work
- end
- end
Add Comment
Please, Sign In to add comment