def apply
return do_reply_to_parent(h.applied_workitem) if tree_children.empty?
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
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 = [] if %w[ highest lowest ].include?(h.cmerge)
h.over = false
apply_children
@context.storage.put_msg(
'reply', 'fei' => h.fei, 'workitem' => h.applied_workitem
) if h.ccount == 0
end