use of io.automatiko.engine.workflow.process.instance.node.FaultNodeInstance 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.");
}
}
Aggregations