def do_reply(msg)

      workitem = msg['workitem']
      fei = workitem['fei']

      removed = h.children.delete(fei)
        # accept without any check ?

      if msg['flanking']

        (h.flanks ||= []) << fei

        if (not removed) # then it's a timer

          do_persist
          return
        end
      end

      if ut = msg['updated_tree']

        ct = tree.dup
        ct.last[Ruote::FlowExpressionId.child_id(fei)] = ut
        update_tree(ct)
      end

      if h.state == 'paused'

        (h.paused_replies ||= []) << msg

        do_persist

      elsif h.state != nil # failing or timing out ...

        if h.children.size < 1
          reply_to_parent(workitem)
        else
          #persist_or_raise # for the updated h.children
          do_persist
        end

      else # vanilla reply

        reply(workitem)
      end
    end
def do_reply(msg)

      workitem = msg['workitem']
      fei = workitem['fei']

      removed = h.children.delete(fei)
        # accept without any check ?

      if msg['flanking']

        (h.flanks ||= []) << fei

        if (not removed) # then it's a timer

          do_persist
          return
        end
      end

      if ut = msg['updated_tree']

        ct = tree.dup
        ct.last[Ruote::FlowExpressionId.child_id(fei)] = ut
        update_tree(ct)
      end

      if h.state == 'paused'

        (h.paused_replies ||= []) << msg

        do_persist

      elsif h.state != nil # failing or timing out ...

        if h.children.size < 1
          reply_to_parent(workitem)
        else
          #persist_or_raise # for the updated h.children
          do_persist
        end

      else # vanilla reply

        reply(workitem)
      end
    end
Wraps #reply (does the administrative part of the reply work).