Search in sources :

Example 1 with EndNodeInstance

use of io.automatiko.engine.workflow.process.instance.node.EndNodeInstance in project automatiko-engine by automatiko-io.

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(IS_FOR_COMPENSATION);
        boolean isForCompensation = compensationBoolObj != null && (Boolean) compensationBoolObj;
        if (isForCompensation) {
            return;
        }
    }
    if (nodeInstance instanceof FaultNodeInstance || nodeInstance instanceof EndNodeInstance || ((io.automatiko.engine.workflow.process.core.WorkflowProcess) getWorkflowProcess()).isDynamic() || nodeInstance instanceof CompositeNodeInstance) {
        if (((io.automatiko.engine.workflow.process.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(io.automatiko.engine.workflow.process.instance.node.FaultNodeInstance) CompositeNodeInstance(io.automatiko.engine.workflow.process.instance.node.CompositeNodeInstance) StateBasedNode(io.automatiko.engine.workflow.process.core.node.StateBasedNode) MilestoneNode(io.automatiko.engine.workflow.process.core.node.MilestoneNode) EventSubProcessNode(io.automatiko.engine.workflow.process.core.node.EventSubProcessNode) StateNode(io.automatiko.engine.workflow.process.core.node.StateNode) Node(io.automatiko.engine.api.definition.process.Node) DynamicNode(io.automatiko.engine.workflow.process.core.node.DynamicNode) StartNode(io.automatiko.engine.workflow.process.core.node.StartNode) EndNode(io.automatiko.engine.workflow.process.core.node.EndNode) EventNode(io.automatiko.engine.workflow.process.core.node.EventNode) ActionNode(io.automatiko.engine.workflow.process.core.node.ActionNode) CompositeNode(io.automatiko.engine.workflow.process.core.node.CompositeNode) BoundaryEventNode(io.automatiko.engine.workflow.process.core.node.BoundaryEventNode) EndNodeInstance(io.automatiko.engine.workflow.process.instance.node.EndNodeInstance) WorkflowProcess(io.automatiko.engine.api.definition.process.WorkflowProcess)

Aggregations

Node (io.automatiko.engine.api.definition.process.Node)1 WorkflowProcess (io.automatiko.engine.api.definition.process.WorkflowProcess)1 ActionNode (io.automatiko.engine.workflow.process.core.node.ActionNode)1 BoundaryEventNode (io.automatiko.engine.workflow.process.core.node.BoundaryEventNode)1 CompositeNode (io.automatiko.engine.workflow.process.core.node.CompositeNode)1 DynamicNode (io.automatiko.engine.workflow.process.core.node.DynamicNode)1 EndNode (io.automatiko.engine.workflow.process.core.node.EndNode)1 EventNode (io.automatiko.engine.workflow.process.core.node.EventNode)1 EventSubProcessNode (io.automatiko.engine.workflow.process.core.node.EventSubProcessNode)1 MilestoneNode (io.automatiko.engine.workflow.process.core.node.MilestoneNode)1 StartNode (io.automatiko.engine.workflow.process.core.node.StartNode)1 StateBasedNode (io.automatiko.engine.workflow.process.core.node.StateBasedNode)1 StateNode (io.automatiko.engine.workflow.process.core.node.StateNode)1 CompositeNodeInstance (io.automatiko.engine.workflow.process.instance.node.CompositeNodeInstance)1 EndNodeInstance (io.automatiko.engine.workflow.process.instance.node.EndNodeInstance)1 FaultNodeInstance (io.automatiko.engine.workflow.process.instance.node.FaultNodeInstance)1