public Object end(final String uri,
final String localName,
final ExtensibleXmlParser parser) throws SAXException {
Element element = parser.endElementBuilder();
StateBasedNode parent = (StateBasedNode) parser.getParent();
String id = element.getAttribute("id");
emptyAttributeCheck( localName, "id", id, parser );
String delay = element.getAttribute("delay");
String period = element.getAttribute("period");
Timer timer = new Timer();
timer.setId(new Long(id));
if (delay != null && delay.length() != 0 ) {
timer.setDelay(delay);
}
if (period != null && period.length() != 0 ) {
timer.setPeriod(period);
}
org.w3c.dom.Node xmlNode = element.getFirstChild();
DroolsAction action = null;
if (xmlNode instanceof Element) {
Element actionXml = (Element) xmlNode;
action = AbstractNodeHandler.extractAction(actionXml);
}
parent.addTimer(timer, action);
return null;
}