def do_misc(action, wi_or_fei_or_wfid, opts)

      opts = Ruote.keys_to_s(opts)

      target = Ruote.extract_id(wi_or_fei_or_wfid)

      if action == 'resume' && opts['anyway']
        #
        # determines the roots of the branches that are paused
        # sends the resume message to them.

        exps = ps(target).expressions.select { |fexp| fexp.state == 'paused' }
        feis = exps.collect { |fexp| fexp.fei }

        roots = exps.inject([]) { |a, fexp|
          a << fexp.fei.to_h unless feis.include?(fexp.parent_id)
          a
        }

        roots.each { |fei| @context.storage.put_msg('resume', 'fei' => fei) }

      elsif target.is_a?(String)
        #
        # action targets a process instance (a string wfid)

        @context.storage.put_msg(
          "#{action}_process", opts.merge('wfid' => target))

      else

        @context.storage.put_msg(
          action, opts.merge('fei' => target))
      end
    end
def do_misc(action, wi_or_fei_or_wfid, opts)

      opts = Ruote.keys_to_s(opts)

      target = Ruote.extract_id(wi_or_fei_or_wfid)

      if action == 'resume' && opts['anyway']
        #
        # determines the roots of the branches that are paused
        # sends the resume message to them.

        exps = ps(target).expressions.select { |fexp| fexp.state == 'paused' }
        feis = exps.collect { |fexp| fexp.fei }

        roots = exps.inject([]) { |a, fexp|
          a << fexp.fei.to_h unless feis.include?(fexp.parent_id)
          a
        }

        roots.each { |fei| @context.storage.put_msg('resume', 'fei' => fei) }

      elsif target.is_a?(String)
        #
        # action targets a process instance (a string wfid)

        @context.storage.put_msg(
          "#{action}_process", opts.merge('wfid' => target))

      else

        @context.storage.put_msg(
          action, opts.merge('fei' => target))
      end
    end
Used by #pause and #resume.