processXml.setActivitys(queryActivityXmlInfo(processXml, document));
return processXml;
}
private static void queryProcessXmlInfo(ProcessElement processXml, Document document) {
Element rootElement = document.getRootElement();
String name = rootElement.attributeValue(StarFlowNames.FLOW_ATTR_NAME);
String chname = rootElement.attributeValue(StarFlowNames.FLOW_ATTR_CHNAME);
String version = rootElement.attributeValue(StarFlowNames.FLOW_ATTR_VERSION);
String xpath = "/ProcessDefine/ProcessProperty/".concat(StarFlowNames.FLOW_CHILD_DESC);
String description = rootElement.selectSingleNode(xpath).getText();
xpath = "/ProcessDefine/ProcessProperty/".concat(StarFlowNames.FLOW_CHILD_LIMITTIME);
String limitTime = rootElement.selectSingleNode(xpath).getText();
processXml.setName(name);
if(chname != null)
processXml.setChname(chname);
else
processXml.setChname(name);
processXml.setVersion(version);
processXml.setDescription(description);
processXml.setLimitTime(Long.parseLong(limitTime));
Element node = (Element)rootElement.selectSingleNode("/ProcessDefine/ProcessProperty");
processXml.setEvents(NodeUtil.getTriggerEvents(node));
processXml.setProperties(NodeUtil.getExtProperties(node));
}