def apply
regex = nil
handler = attribute_text
if handler == ''
regex = (attributes.keys - COMMON_ATT_KEYS).first
handler = attribute(regex)
end
if tree.last.size > 0
regex = handler
handler = [ 'sequence', {}, Ruote.fulldup(tree.last) ]
end
return reply_to_parent(h.applied_workitem) if regex.nil? && handler.nil?
par = parent
oe = par.h.on_error
if oe.is_a?(String) or Ruote.is_tree?(oe)
oe = [ nil, oe ]
end
oe = Array(par.h.on_error).compact
oe << [ regex, handler, fei.child_id ]
par.h.on_error = oe
if par.do_persist
reply_to_parent(h.applied_workitem)
else
apply
end
end