protected boolean isTerminated(NodeInstance from) { if (from instanceof EndNodeInstance) { return ((EndNodeInstance) from).getEndNode().isTerminate(); } return false; }
public EndNode getEndNode() { return (EndNode) getNode(); }
if (getNode().getMetaData().get("hidden") != null) { hidden = true; InternalKnowledgeRuntime kruntime = getProcessInstance().getKnowledgeRuntime(); if (!hidden) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireBeforeNodeLeft(this, kruntime); ((NodeInstanceContainer) getNodeInstanceContainer()).removeNodeInstance(this); if (getEndNode().isTerminate()) { if (getNodeInstanceContainer() instanceof CompositeNodeInstance) { if (getEndNode().getScope() == EndNode.PROCESS_SCOPE) { getProcessInstance().setState( ProcessInstance.STATE_COMPLETED ); } else { while (!getNodeInstanceContainer().getNodeInstances().isEmpty()) { ((org.jbpm.workflow.instance.NodeInstance) getNodeInstanceContainer().getNodeInstances().iterator().next()).cancel(); ((NodeInstanceContainer) getNodeInstanceContainer()).nodeInstanceCompleted(this, null); ((NodeInstanceContainer) getNodeInstanceContainer()).setState( ProcessInstance.STATE_COMPLETED ); ((NodeInstanceContainer) getNodeInstanceContainer()) .nodeInstanceCompleted(this, null);
if (getNode().getMetaData().get("hidden") != null) { hidden = true; InternalKnowledgeRuntime kruntime = getProcessInstance().getKnowledgeRuntime(); if (!hidden) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireBeforeNodeLeft(this, kruntime); ((NodeInstanceContainer) getNodeInstanceContainer()).removeNodeInstance(this); if (getEndNode().isTerminate()) { if (getNodeInstanceContainer() instanceof CompositeNodeInstance) { if (getEndNode().getScope() == EndNode.PROCESS_SCOPE) { getProcessInstance().setState( ProcessInstance.STATE_COMPLETED ); } else { while (!getNodeInstanceContainer().getNodeInstances().isEmpty()) { ((org.jbpm.workflow.instance.NodeInstance) getNodeInstanceContainer().getNodeInstances().iterator().next()).cancel(); ((NodeInstanceContainer) getNodeInstanceContainer()).nodeInstanceCompleted(this, null); ((NodeInstanceContainer) getNodeInstanceContainer()).setState( ProcessInstance.STATE_COMPLETED ); ((NodeInstanceContainer) getNodeInstanceContainer()) .nodeInstanceCompleted(this, null);
protected boolean isTerminated(NodeInstance from) { if (from instanceof EndNodeInstance) { return ((EndNodeInstance) from).getEndNode().isTerminate(); } return false; }
public EndNode getEndNode() { return (EndNode) getNode(); }