def re_dispatch(wi=nil, opts=nil)

      wi, opts = [ nil, wi ] if wi.is_a?(Hash) && opts.nil?
      wi ||= workitem()
      opts ||= {}

      wi.h.re_dispatch_count = wi.h.re_dispatch_count.to_s.to_i + 1

      msg = {
        'action' => 'dispatch',
        'fei' => wi.h.fei,
        'workitem' => wi.to_h,
        'participant_name' => wi.participant_name
      }

      if t = opts[:in] || opts[:at]

        sched_id = @context.storage.put_schedule('at', wi.h.fei, t, msg)

        exp = fexp(wi)
        exp.h['re_dispatch_sched_id'] = sched_id
        exp.try_persist

      else

        @context.storage.put_msg('dispatch', msg)
      end
    end
def re_dispatch(wi=nil, opts=nil)

      wi, opts = [ nil, wi ] if wi.is_a?(Hash) && opts.nil?
      wi ||= workitem()
      opts ||= {}

      wi.h.re_dispatch_count = wi.h.re_dispatch_count.to_s.to_i + 1

      msg = {
        'action' => 'dispatch',
        'fei' => wi.h.fei,
        'workitem' => wi.to_h,
        'participant_name' => wi.participant_name
      }

      if t = opts[:in] || opts[:at]

        sched_id = @context.storage.put_schedule('at', wi.h.fei, t, msg)

        exp = fexp(wi)
        exp.h['re_dispatch_sched_id'] = sched_id
        exp.try_persist

      else

        @context.storage.put_msg('dispatch', msg)
      end
    end
Use this method to re_dispatch the workitem.

 It takes two options :in and :at for "later re_dispatch".

 Look at the unschedule_re_dispatch method for an example of
 participant implementation that uses re_dispatch.

 Without one of those options, the method is a "reject".