public NodeContainer getNodeContainer() { return getCompositeNode(); }
public void nodeInstanceCompleted(NodeInstance nodeInstance, String outType) { Node nodeInstanceNode = nodeInstance.getNode(); if( nodeInstanceNode != null ) { Object compensationBoolObj = nodeInstanceNode.getMetaData().get("isForCompensation"); boolean isForCompensation = compensationBoolObj == null ? false : ((Boolean) compensationBoolObj); if( isForCompensation ) { return; } } if (nodeInstance instanceof FaultNodeInstance || nodeInstance instanceof EndNodeInstance || nodeInstance instanceof EventSubProcessNodeInstance ) { if (getCompositeNode().isAutoComplete()) { if (nodeInstances.isEmpty()) { triggerCompleted( org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE); } } } else { throw new IllegalArgumentException( "Completing a node instance that has no outgoing connection not supported."); } }
public void triggerCompleted(String outType) { boolean cancelRemainingInstances = getCompositeNode().isCancelRemainingInstances(); ((org.jbpm.workflow.instance.NodeInstanceContainer)getNodeInstanceContainer()).setCurrentLevel(getLevel()); triggerCompleted(outType, cancelRemainingInstances); if (cancelRemainingInstances) { while (!nodeInstances.isEmpty()) { NodeInstance nodeInstance = (NodeInstance) nodeInstances.get(0); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).cancel(); } } }
private void registerExternalEventNodeListeners() { for (Node node: getCompositeNode().getNodes()) { if (node instanceof EventNode) { if ("external".equals(((EventNode) node).getScope())) { getProcessInstance().addEventListener( ((EventNode) node).getType(), EMPTY_EVENT_LISTENER, true); } } else if (node instanceof EventSubProcessNode) { List<String> events = ((EventSubProcessNode) node).getEvents(); for (String type : events) { getProcessInstance().addEventListener(type, EMPTY_EVENT_LISTENER, true); } } } }
@Override public void signalEvent(String type, Object event) { List<NodeInstance> currentView = new ArrayList<NodeInstance>(this.nodeInstances); super.signalEvent(type, event); for (Node node: getCompositeNode().internalGetNodes()) { if (node instanceof EventNodeInterface) { if (((EventNodeInterface) node).acceptsEvent(type, event)) { if (node instanceof EventNode && ((EventNode) node).getFrom() == null) { EventNodeInstanceInterface eventNodeInstance = (EventNodeInstanceInterface) getNodeInstance(node); eventNodeInstance.signalEvent(type, event); } else if( node instanceof EventSubProcessNode ) { EventNodeInstanceInterface eventNodeInstance = (EventNodeInstanceInterface) getNodeInstance(node); eventNodeInstance.signalEvent(type, event); } else { List<NodeInstance> nodeInstances = getNodeInstances(node.getId(), currentView); if (nodeInstances != null && !nodeInstances.isEmpty()) { for (NodeInstance nodeInstance : nodeInstances) { ((EventNodeInstanceInterface) nodeInstance) .signalEvent(type, event); } } } } } } }
return; CompositeNode.NodeAndType nodeAndType = getCompositeNode().internalGetLinkedIncomingNode(type); if (nodeAndType != null) { List<Connection> connections = nodeAndType.getNode().getIncomingConnections(nodeAndType.getType()); for (Node node: getCompositeNode().getNodes()) { if (node instanceof StartNode) { StartNode startNode = (StartNode) node;
public NodeContainer getNodeContainer() { return getCompositeNode(); }
public void nodeInstanceCompleted(NodeInstance nodeInstance, String outType) { Node nodeInstanceNode = nodeInstance.getNode(); if( nodeInstanceNode != null ) { Object compensationBoolObj = nodeInstanceNode.getMetaData().get("isForCompensation"); boolean isForCompensation = compensationBoolObj == null ? false : ((Boolean) compensationBoolObj); if( isForCompensation ) { return; } } if (nodeInstance instanceof FaultNodeInstance || nodeInstance instanceof EndNodeInstance || nodeInstance instanceof EventSubProcessNodeInstance ) { if (getCompositeNode().isAutoComplete()) { if (nodeInstances.isEmpty()) { triggerCompleted( org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE); } } } else { throw new IllegalArgumentException( "Completing a node instance that has no outgoing connection not supported."); } }
public void triggerCompleted(String outType) { boolean cancelRemainingInstances = getCompositeNode().isCancelRemainingInstances(); ((org.jbpm.workflow.instance.NodeInstanceContainer)getNodeInstanceContainer()).setCurrentLevel(getLevel()); triggerCompleted(outType, cancelRemainingInstances); if (cancelRemainingInstances) { while (!nodeInstances.isEmpty()) { NodeInstance nodeInstance = (NodeInstance) nodeInstances.get(0); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).cancel(); } } }
private void registerExternalEventNodeListeners() { for (Node node: getCompositeNode().getNodes()) { if (node instanceof EventNode) { if ("external".equals(((EventNode) node).getScope())) { getProcessInstance().addEventListener( ((EventNode) node).getType(), EMPTY_EVENT_LISTENER, true); } } else if (node instanceof EventSubProcessNode) { List<String> events = ((EventSubProcessNode) node).getEvents(); for (String type : events) { getProcessInstance().addEventListener(type, EMPTY_EVENT_LISTENER, true); } } } }
@Override public void signalEvent(String type, Object event) { List<NodeInstance> currentView = new ArrayList<NodeInstance>(this.nodeInstances); super.signalEvent(type, event); for (Node node: getCompositeNode().internalGetNodes()) { if (node instanceof EventNodeInterface) { if (((EventNodeInterface) node).acceptsEvent(type, event)) { if (node instanceof EventNode && ((EventNode) node).getFrom() == null) { EventNodeInstanceInterface eventNodeInstance = (EventNodeInstanceInterface) getNodeInstance(node); eventNodeInstance.signalEvent(type, event); } else if( node instanceof EventSubProcessNode ) { EventNodeInstanceInterface eventNodeInstance = (EventNodeInstanceInterface) getNodeInstance(node); eventNodeInstance.signalEvent(type, event); } else { List<NodeInstance> nodeInstances = getNodeInstances(node.getId(), currentView); if (nodeInstances != null && !nodeInstances.isEmpty()) { for (NodeInstance nodeInstance : nodeInstances) { ((EventNodeInstanceInterface) nodeInstance) .signalEvent(type, event); } } } } } } }
return; CompositeNode.NodeAndType nodeAndType = getCompositeNode().internalGetLinkedIncomingNode(type); if (nodeAndType != null) { List<Connection> connections = nodeAndType.getNode().getIncomingConnections(nodeAndType.getType()); for (Node node: getCompositeNode().getNodes()) { if (node instanceof StartNode) { StartNode startNode = (StartNode) node;