# File lib/ruote/log/wait_logger.rb, line 218
    def matches(interests, msg)

      action = msg['action']

      interests.each do |interest|

        satisfied = case interest

          when :or_error
            #
            # let's force an immediate reply

            interests.clear if action == 'error_intercepted'

          when :inactive

            (FINAL_ACTIONS.include?(action) && @context.worker.inactive?)

          when :empty

            (action == 'terminated' && @context.storage.empty?('expressions'))

          when Symbol

            (action == 'dispatch' && msg['participant_name'] == interest.to_s)

          when Fixnum

            interests.delete(interest)

            if (interest > 1)
              interests << (interest - 1)
              false
            else
              true
            end

          when Hash

            interest.all? { |k, v|
              k = 'tree.0' if k == 'exp_name'
              Ruote.lookup(msg, k) == v
            }

          when /^[a-z_]+$/

            (action == interest)

          else # wfid

            (FINAL_ACTIONS.include?(action) && msg['wfid'] == interest)
        end

        interests.delete(interest) if satisfied
      end

      if interests.include?(:or_error)
        (interests.size < 2)
      else
        (interests.size < 1)
      end
    end