split.setMetaData("hidden", true); split.setMetaData("UniqueId", getMetaData("Uniqueid") + ":foreach:split"); super.addNode(split); super.linkIncomingConnections( org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE, new CompositeNode.NodeAndType(split, org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE)); CompositeContextNode compositeNode = new CompositeContextNode(); compositeNode.setName("ForEachComposite"); compositeNode.setMetaData("hidden", true); compositeNode.setMetaData("UniqueId", getMetaData("Uniqueid") + ":foreach:composite"); super.addNode(compositeNode); VariableScope variableScope = new VariableScope(); compositeNode.addContext(variableScope); compositeNode.setDefaultContext(variableScope); join.setMetaData("hidden", true); join.setMetaData("UniqueId", getMetaData("Uniqueid") + ":foreach:join"); super.addNode(join); super.linkOutgoingConnections( new CompositeNode.NodeAndType(join, org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE), org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE); new ConnectionImpl( super.getNode(1), org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE, getCompositeNode(), org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE ); new ConnectionImpl( getCompositeNode(), org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE, super.getNode(3), org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE
public DynamicNodeFactory exceptionHandler(String exception, ExceptionHandler exceptionHandler) { ExceptionScope exceptionScope = (ExceptionScope) getCompositeNode().getDefaultContext(ExceptionScope.EXCEPTION_SCOPE); if (exceptionScope == null) { exceptionScope = new ExceptionScope(); getCompositeNode().addContext(exceptionScope); getCompositeNode().setDefaultContext(exceptionScope); } exceptionScope.setExceptionHandler(exception, exceptionHandler); return this; }
associations = (List<Association>) compositeNode.getMetaData(ASSOCIATIONS); if (associations == null) { associations = new ArrayList<Association>(); compositeNode.setMetaData(ProcessHandler.ASSOCIATIONS, associations);
protected Node createNode() { CompositeContextNode result = new CompositeContextNode(); VariableScope variableScope = new VariableScope(); result.addContext(variableScope); result.setDefaultContext(variableScope); return result; }
@Override public Context getContext(String contextType) { Context context = getCompositeNode().getDefaultContext(contextType); if (context != null) { return context; } return super.getContext(contextType); }
public CompositeNodeFactory(RuleFlowNodeContainerFactory nodeContainerFactory, NodeContainer nodeContainer, long id) { this.nodeContainerFactory = nodeContainerFactory; this.nodeContainer = nodeContainer; CompositeContextNode compositeNode = new CompositeContextNode(); compositeNode.setId(id); setNodeContainer(compositeNode); }
forEachNode.setWaitForCompletion(false); ActionNode subActionNode1 = new ActionNode(); forEachNode.getCompositeNode().addNode(subActionNode1); ActionNode subActionNode2 = new ActionNode(); forEachNode.getCompositeNode().addNode(subActionNode2); new ConnectionImpl(subActionNode1, Node.CONNECTION_DEFAULT_TYPE, subActionNode2, Node.CONNECTION_DEFAULT_TYPE); forEachNode.getCompositeNode().linkIncomingConnections(Node.CONNECTION_DEFAULT_TYPE, subActionNode1.getId(), Node.CONNECTION_DEFAULT_TYPE); forEachNode.getCompositeNode().linkOutgoingConnections(subActionNode2.getId(), Node.CONNECTION_DEFAULT_TYPE, Node.CONNECTION_DEFAULT_TYPE); process.addNode(forEachNode); new ConnectionImpl(timerNode, Node.CONNECTION_DEFAULT_TYPE, forEachNode, Node.CONNECTION_DEFAULT_TYPE); CompositeContextNode compositeNode = new CompositeContextNode(); compositeNode.setName("Composite"); VariableScope variableScope = new VariableScope(); compositeNode.addContext(variableScope); compositeNode.setDefaultContext(variableScope); variableScope.setVariables(variables); ExceptionScope exceptionScope = new ExceptionScope(); compositeNode.addContext(exceptionScope); compositeNode.setDefaultContext(exceptionScope); exceptionHandler = new ActionExceptionHandler(); exceptionHandler.setFaultVariable("faultVariable"); exceptionScope.setExceptionHandler("MyFault2", exceptionHandler); subActionNode1 = new ActionNode(); compositeNode.addNode(subActionNode1); subActionNode2 = new ActionNode(); compositeNode.addNode(subActionNode2); new ConnectionImpl(subActionNode1, Node.CONNECTION_DEFAULT_TYPE, subActionNode2, Node.CONNECTION_DEFAULT_TYPE);
protected Node createNode(Attributes attrs) { CompositeContextNode subProcessNode = new CompositeContextNode(); String eventSubprocessAttribute = attrs.getValue("triggeredByEvent"); if (eventSubprocessAttribute != null && Boolean.parseBoolean(eventSubprocessAttribute)) { subProcessNode = new EventSubProcessNode(); } VariableScope variableScope = new VariableScope(); subProcessNode.addContext(variableScope); subProcessNode.setDefaultContext(variableScope); String compensation = attrs.getValue("isForCompensation"); if( compensation != null ) { boolean isForCompensation = Boolean.parseBoolean(compensation); if( isForCompensation ) { subProcessNode.setMetaData("isForCompensation", isForCompensation ); } } subProcessNode.setAutoComplete(true); return subProcessNode; }
forEachNode.setName(node.getName()); forEachNode.setAutoComplete(((CompositeContextNode) node).isAutoComplete()); for (org.kie.api.definition.process.Node subNode: ((CompositeContextNode) node).getNodes()) { forEachNode.setMetaData("UniqueId", ((CompositeContextNode) node).getMetaData("UniqueId")); forEachNode.setMetaData(ProcessHandler.CONNECTIONS, ((CompositeContextNode) node).getMetaData(ProcessHandler.CONNECTIONS)); VariableScope v = (VariableScope) ((CompositeContextNode) node).getDefaultContext(VariableScope.VARIABLE_SCOPE); ((VariableScope) ((CompositeContextNode) forEachNode.internalGetNode(2)).getDefaultContext(VariableScope.VARIABLE_SCOPE)).setVariables(v.getVariables()); node = forEachNode; handleForEachNode(node, element, uri, localName, parser, isAsync);
public ContextInstance getContextInstance(String contextId) { ContextInstance contextInstance = this.contextInstances.get(contextId); if (contextInstance != null) { return contextInstance; } Context context = getCompositeContextNode().getDefaultContext(contextId); if (context != null) { contextInstance = getContextInstance(context); return contextInstance; } return null; }
public RuleFlowNodeContainerFactory done() { if (linkedIncomingNodeId != -1) { getCompositeNode().linkIncomingConnections( Node.CONNECTION_DEFAULT_TYPE, linkedIncomingNodeId, Node.CONNECTION_DEFAULT_TYPE); } if (linkedOutgoingNodeId != -1) { getCompositeNode().linkOutgoingConnections( linkedOutgoingNodeId, Node.CONNECTION_DEFAULT_TYPE, Node.CONNECTION_DEFAULT_TYPE); } nodeContainer.addNode(getCompositeNode()); return nodeContainerFactory; }
xmlDump.append(" triggeredByEvent=\"true\" "); Object isForCompensationObject = compositeNode.getMetaData("isForCompensation"); if( isForCompensationObject != null && ((Boolean) isForCompensationObject) ) { xmlDump.append("isForCompensation=\"true\" "); compositeNode.getDefaultContext(VariableScope.VARIABLE_SCOPE); if (variableScope != null && !variableScope.getVariables().isEmpty()) { xmlDump.append(" <!-- variables -->" + EOL);
@Override public void setDefaultContext(Context context) { getCompositeNode().setDefaultContext(context); ((AbstractContext) context).setContextContainer(getCompositeNode()); }
@Override public void addContext(Context context) { getCompositeNode().addContext(context); ((AbstractContext) context).setContextContainer(getCompositeNode()); }
process.addNode(new HumanTaskNode()); process.addNode(new ForEachNode()); process.addNode(new CompositeContextNode()); process.addNode(new EventNode()); process.addNode(new FaultNode());
public Node[] internalGetNodes() { return super.getNodes(); }
protected void internalAddNode(Node node) { super.addNode(node); }
CompositeContextNode compositeNode = (CompositeContextNode) node; List<SequenceFlow> connections = (List<SequenceFlow>) compositeNode.getMetaData(ProcessHandler.CONNECTIONS); List<IntermediateLink> throwLinks = (List<IntermediateLink>) compositeNode.getMetaData(ProcessHandler.LINKS); ProcessHandler.linkIntermediateLinks(compositeNode, throwLinks); List<Association> associations = (List<Association>) compositeNode.getMetaData(ProcessHandler.ASSOCIATIONS); ProcessHandler.linkAssociations((Definitions) compositeNode.getMetaData("Definitions"), compositeNode, associations);
public void linkIncomingConnections(String inType, long inNodeId, String inNodeType) { getCompositeNode().linkIncomingConnections(inType, inNodeId, inNodeType); }
public void linkOutgoingConnections(long outNodeId, String outNodeType, String outType) { getCompositeNode().linkOutgoingConnections(outNodeId, outNodeType, outType); }