Search in sources :

Example 1 with FaultNodeInstance

use of org.jbpm.workflow.instance.node.FaultNodeInstance in project jbpm by kiegroup.

the class WorkflowProcessInstanceImpl method nodeInstanceCompleted.

@Override
public void nodeInstanceCompleted(NodeInstance nodeInstance, String outType) {
    Node nodeInstanceNode = nodeInstance.getNode();
    if (nodeInstanceNode != null) {
        Object compensationBoolObj = nodeInstanceNode.getMetaData().get("isForCompensation");
        boolean isForCompensation = compensationBoolObj != null && (Boolean) compensationBoolObj;
        if (isForCompensation) {
            return;
        }
    }
    if (nodeInstance instanceof FaultNodeInstance || nodeInstance instanceof EndNodeInstance || ((org.jbpm.workflow.core.WorkflowProcess) getWorkflowProcess()).isDynamic() || nodeInstance instanceof CompositeNodeInstance) {
        if (((org.jbpm.workflow.core.WorkflowProcess) getProcess()).isAutoComplete() && canComplete()) {
            setState(ProcessInstance.STATE_COMPLETED);
        }
    } else {
        throw new IllegalArgumentException("Completing a node instance that has no outgoing connection is not supported.");
    }
}
Also used : FaultNodeInstance(org.jbpm.workflow.instance.node.FaultNodeInstance) CompositeNodeInstance(org.jbpm.workflow.instance.node.CompositeNodeInstance) ForEachNode(org.jbpm.workflow.core.node.ForEachNode) BoundaryEventNode(org.jbpm.workflow.core.node.BoundaryEventNode) DynamicNode(org.jbpm.workflow.core.node.DynamicNode) AsyncEventNode(org.jbpm.workflow.core.node.AsyncEventNode) StateNode(org.jbpm.workflow.core.node.StateNode) CompositeContextNode(org.jbpm.workflow.core.node.CompositeContextNode) StateBasedNode(org.jbpm.workflow.core.node.StateBasedNode) EventSubProcessNode(org.jbpm.workflow.core.node.EventSubProcessNode) ActionNode(org.jbpm.workflow.core.node.ActionNode) EndNode(org.jbpm.workflow.core.node.EndNode) EventNode(org.jbpm.workflow.core.node.EventNode) Node(org.kie.api.definition.process.Node) EndNodeInstance(org.jbpm.workflow.instance.node.EndNodeInstance) WorkflowProcess(org.kie.api.definition.process.WorkflowProcess)

Aggregations

ActionNode (org.jbpm.workflow.core.node.ActionNode)1 AsyncEventNode (org.jbpm.workflow.core.node.AsyncEventNode)1 BoundaryEventNode (org.jbpm.workflow.core.node.BoundaryEventNode)1 CompositeContextNode (org.jbpm.workflow.core.node.CompositeContextNode)1 DynamicNode (org.jbpm.workflow.core.node.DynamicNode)1 EndNode (org.jbpm.workflow.core.node.EndNode)1 EventNode (org.jbpm.workflow.core.node.EventNode)1 EventSubProcessNode (org.jbpm.workflow.core.node.EventSubProcessNode)1 ForEachNode (org.jbpm.workflow.core.node.ForEachNode)1 StateBasedNode (org.jbpm.workflow.core.node.StateBasedNode)1 StateNode (org.jbpm.workflow.core.node.StateNode)1 CompositeNodeInstance (org.jbpm.workflow.instance.node.CompositeNodeInstance)1 EndNodeInstance (org.jbpm.workflow.instance.node.EndNodeInstance)1 FaultNodeInstance (org.jbpm.workflow.instance.node.FaultNodeInstance)1 Node (org.kie.api.definition.process.Node)1 WorkflowProcess (org.kie.api.definition.process.WorkflowProcess)1