use of io.automatiko.engine.workflow.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);
postProcessCollaborations(process, parser);
return process;
}
use of io.automatiko.engine.workflow.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 if (XmlBPMNProcessDumper.FEEL_LANGUAGE.equals(language)) {
sequenceFlow.setLanguage("FEEL");
} else {
throw new IllegalArgumentException("Unknown language " + language);
}
}
sequenceFlow.setExpression(expression);
}
xmlNode = xmlNode.getNextSibling();
}
return sequenceFlow;
}
use of io.automatiko.engine.workflow.bpmn2.core.SequenceFlow in project kogito-runtimes 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.FEEL_LANGUAGE.equals(language) || XmlBPMNProcessDumper.DMN_FEEL_LANGUAGE.equals(language)) {
sequenceFlow.setLanguage("FEEL");
} else {
throw new ProcessParsingValidationException("Unknown language " + language);
}
}
sequenceFlow.setExpression(expression);
}
xmlNode = xmlNode.getNextSibling();
}
return sequenceFlow;
}
use of io.automatiko.engine.workflow.bpmn2.core.SequenceFlow in project automatiko-engine by automatiko-io.
the class AdHocSubProcessHandler method handleNode.
@SuppressWarnings("unchecked")
@Override
protected void handleNode(final Node node, final Element element, final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException {
super.handleNode(node, element, uri, localName, parser);
DynamicNode dynamicNode = (DynamicNode) node;
String cancelRemainingInstances = element.getAttribute("cancelRemainingInstances");
if ("false".equals(cancelRemainingInstances)) {
dynamicNode.setCancelRemainingInstances(false);
}
// by default it should not autocomplete as it's adhoc
org.w3c.dom.Node xmlNode = element.getFirstChild();
dynamicNode.setActivationCondition((String) node.getMetaData().get(CUSTOM_ACTIVATION_CONDITION));
while (xmlNode != null) {
String nodeName = xmlNode.getNodeName();
if (COMPLETION_CONDITION.equals(nodeName)) {
String expression = xmlNode.getTextContent();
if (AUTOCOMPLETE_EXPRESSIONS.contains(expression)) {
dynamicNode.setAutoComplete(true);
} else {
dynamicNode.setCompletionCondition(expression);
}
}
xmlNode = xmlNode.getNextSibling();
}
List<SequenceFlow> connections = (List<SequenceFlow>) dynamicNode.getMetaData(ProcessHandler.CONNECTIONS);
ProcessHandler processHandler = new ProcessHandler();
processHandler.linkConnections(dynamicNode, connections);
processHandler.linkBoundaryEvents(dynamicNode);
handleScript(dynamicNode, element, "onEntry");
handleScript(dynamicNode, element, "onExit");
}
use of io.automatiko.engine.workflow.bpmn2.core.SequenceFlow in project automatiko-engine by automatiko-io.
the class SubProcessHandler method handleCompositeContextNode.
@SuppressWarnings("unchecked")
protected void handleCompositeContextNode(final Node node, final Element element, final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException {
super.handleNode(node, element, uri, localName, parser);
CompositeContextNode compositeNode = (CompositeContextNode) node;
List<SequenceFlow> connections = (List<SequenceFlow>) compositeNode.getMetaData(ProcessHandler.CONNECTIONS);
handleScript(compositeNode, element, "onEntry");
handleScript(compositeNode, element, "onExit");
List<IntermediateLink> throwLinks = (List<IntermediateLink>) compositeNode.getMetaData(ProcessHandler.LINKS);
ProcessHandler.linkIntermediateLinks(compositeNode, throwLinks);
ProcessHandler processHandler = new ProcessHandler();
processHandler.linkConnections(compositeNode, connections);
processHandler.linkBoundaryEvents(compositeNode);
// This must be done *after* linkConnections(process, connections)
// because it adds hidden connections for compensations
List<Association> associations = (List<Association>) compositeNode.getMetaData(ProcessHandler.ASSOCIATIONS);
ProcessHandler.linkAssociations((Definitions) compositeNode.getMetaData("Definitions"), compositeNode, associations);
// TODO: do we fully support interruping ESP's?
/**
* for( org.kie.api.definition.process.Node subNode : compositeNode.getNodes() )
* { if( subNode instanceof StartNode ) { if( ! ((StartNode)
* subNode).isInterrupting() ) { throw new
* IllegalArgumentException("Non-interrupting event subprocesses are not yet
* fully supported." ); } } }
*/
}
Aggregations