Search in sources :

Example 1 with PipelineExecutorException

use of org.guvnor.ala.pipeline.execution.PipelineExecutorException in project kie-wb-common by kiegroup.

the class PipelineExecutorTaskManagerImpl method delete.

@Override
public void delete(final String taskId) throws PipelineExecutorException {
    final TaskEntry entry = getTaskEntry(taskId);
    if (entry != null) {
        throw new PipelineExecutorException("An active PipelineExecutorTask was found for taskId: " + taskId + " delete operation is only available for the following status set: " + deleteEnabledStatus);
    }
    final PipelineExecutorTrace trace = pipelineExecutorRegistry.getExecutorTrace(taskId);
    if (trace == null) {
        throw new PipelineExecutorException("No PipelineExecutorTask was found for taskId: " + taskId);
    } else {
        if (!deleteEnabledStatus.contains(trace.getTask().getPipelineStatus())) {
            throw new PipelineExecutorException("A PipelineExecutorTask in status: " + trace.getTask().getPipelineStatus().name() + " can not" + " be deleted. Delete operation is available for the following status set: " + deleteEnabledStatus);
        } else {
            pipelineExecutorRegistry.deregister(taskId);
        }
    }
}
Also used : PipelineExecutorTrace(org.guvnor.ala.pipeline.execution.PipelineExecutorTrace) PipelineExecutorException(org.guvnor.ala.pipeline.execution.PipelineExecutorException)

Aggregations

PipelineExecutorException (org.guvnor.ala.pipeline.execution.PipelineExecutorException)1 PipelineExecutorTrace (org.guvnor.ala.pipeline.execution.PipelineExecutorTrace)1