use of org.jbpm.bpmn2.core.SequenceFlow in project jbpm by kiegroup.
the class ProcessHandler method end.
@SuppressWarnings("unchecked")
public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException {
parser.endElementBuilder();
RuleFlowProcess process = (RuleFlowProcess) parser.getCurrent();
List<IntermediateLink> throwLinks = (List<IntermediateLink>) process.getMetaData(LINKS);
linkIntermediateLinks(process, throwLinks);
List<SequenceFlow> connections = (List<SequenceFlow>) process.getMetaData(CONNECTIONS);
linkConnections(process, connections);
linkBoundaryEvents(process);
// This must be done *after* linkConnections(process, connections)
// because it adds hidden connections for compensations
List<Association> associations = (List<Association>) process.getMetaData(ASSOCIATIONS);
linkAssociations((Definitions) process.getMetaData("Definitions"), process, associations);
List<Lane> lanes = (List<Lane>) process.getMetaData(LaneHandler.LANES);
assignLanes(process, lanes);
postProcessNodes(process, process);
return process;
}
use of org.jbpm.bpmn2.core.SequenceFlow in project jbpm by kiegroup.
the class SequenceFlowHandler method end.
public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException {
final Element element = parser.endElementBuilder();
SequenceFlow sequenceFlow = (SequenceFlow) parser.getCurrent();
org.w3c.dom.Node xmlNode = element.getFirstChild();
while (xmlNode != null) {
String nodeName = xmlNode.getNodeName();
if ("conditionExpression".equals(nodeName)) {
String expression = xmlNode.getTextContent();
org.w3c.dom.Node languageNode = xmlNode.getAttributes().getNamedItem("language");
if (languageNode != null) {
String language = languageNode.getNodeValue();
if (XmlBPMNProcessDumper.JAVA_LANGUAGE.equals(language)) {
sequenceFlow.setLanguage("java");
} else if (XmlBPMNProcessDumper.MVEL_LANGUAGE.equals(language)) {
sequenceFlow.setLanguage("mvel");
} else if (XmlBPMNProcessDumper.RULE_LANGUAGE.equals(language)) {
sequenceFlow.setType("rule");
} else if (XmlBPMNProcessDumper.XPATH_LANGUAGE.equals(language)) {
sequenceFlow.setLanguage("XPath");
} else if (XmlBPMNProcessDumper.JAVASCRIPT_LANGUAGE.equals(language)) {
sequenceFlow.setLanguage("JavaScript");
} else {
throw new IllegalArgumentException("Unknown language " + language);
}
}
sequenceFlow.setExpression(expression);
}
xmlNode = xmlNode.getNextSibling();
}
return sequenceFlow;
}
Aggregations