# File lib/ruote/exp/fe_concurrence.rb, line 281
    def apply

      return do_reply_to_parent(h.applied_workitem) if tree_children.empty?

      #
      # count and wait_for

      count = (attribute(:count) || attribute(:c)).to_s
      count = nil unless COUNT_R.match(count)

      wf = count || attribute(:wait_for) || attribute(:wf)

      if COUNT_R.match(wf.to_s)
        h.ccount = wf.to_i
      elsif wf
        h.wait_for = Ruote.comma_split(wf)
      end

      #
      # other attributes

      h.cmerge = att(
        [ :merge, :m ],
        %w[ first last highest lowest ])
      h.cmerge_type = att(
        [ :merge_type, :mt ],
        %w[ override mix isolate stack union ignore concat deep ])
      h.remaining = att(
        [ :remaining, :rem, :r ],
        %w[ cancel forget wait ])

      #h.workitems = (h.cmerge == 'first' || h.cmerge == 'last') ? [] : {}
        #
        # now merging iteratively, not keeping track of all the workitems,
        # but still able to deal with old flows with active h.workitems
        #
      h.workitems = [] if %w[ highest lowest ].include?(h.cmerge)
        #
        # still need to keep track of rank to get the right merging

      h.over = false

      apply_children

      @context.storage.put_msg(
        'reply', 'fei' => h.fei, 'workitem' => h.applied_workitem
      ) if h.ccount == 0
        #
        # force an immediate reply
    end