use of org.guvnor.ala.pipeline.execution.PipelineExecutorError in project kie-wb-common by kiegroup.
the class PipelineExecutorTaskManagerImpl method onStageError.
private void onStageError(final OnErrorStageExecutionEvent oesee, final TaskEntry taskEntry) {
taskEntry.getTask().setPipelineStatus(PipelineExecutorTask.Status.ERROR);
taskEntry.getTask().setStageStatus(oesee.getStage().getName(), PipelineExecutorTask.Status.ERROR);
taskEntry.getTask().setStageError(oesee.getStage().getName(), new PipelineExecutorError(oesee.getError().getMessage(), oesee.getError()));
if (taskEntry.isAsync()) {
updateExecutorRegistry(taskEntry.getTask());
}
}
use of org.guvnor.ala.pipeline.execution.PipelineExecutorError in project kie-wb-common by kiegroup.
the class PipelineExecutorTaskManagerImpl method onPipelineError.
private void onPipelineError(final OnErrorPipelineExecutionEvent oepee, final TaskEntry taskEntry) {
taskEntry.getTask().setPipelineStatus(PipelineExecutorTask.Status.ERROR);
taskEntry.getTask().setPipelineError(new PipelineExecutorError(oepee.getError().getMessage(), oepee.getError()));
if (taskEntry.isAsync()) {
updateExecutorRegistry(taskEntry.getTask());
}
}
use of org.guvnor.ala.pipeline.execution.PipelineExecutorError in project kie-wb-common by kiegroup.
the class PipelineExecutorTaskManagerImplEventsTest method testOnStageErrorExecutionEvent.
private void testOnStageErrorExecutionEvent(boolean async) {
when(taskEntry.isAsync()).thenReturn(async);
OnErrorStageExecutionEvent event = new OnErrorStageExecutionEvent(TASK_ID, pipeline, stage, error);
taskManager.localListener.onStageError(event);
verify(task, times(1)).setPipelineStatus(PipelineExecutorTask.Status.ERROR);
verify(task, times(1)).setStageStatus(stage.getName(), PipelineExecutorTask.Status.ERROR);
verify(task, times(1)).setStageError(eq(stage.getName()), pipelineExecutorErrorCaptor.capture());
assertEquals(new PipelineExecutorError(ERROR_MESSAGE, error), pipelineExecutorErrorCaptor.getValue());
verifyExecutorRegistryUpdated(async);
verifyExternalListenersNotified(event);
}
use of org.guvnor.ala.pipeline.execution.PipelineExecutorError in project kie-wb-common by kiegroup.
the class PipelineExecutorTaskManagerImplEventsTest method testOnPipelineErrorExecutionEvent.
private void testOnPipelineErrorExecutionEvent(boolean async) {
when(taskEntry.isAsync()).thenReturn(async);
OnErrorPipelineExecutionEvent event = new OnErrorPipelineExecutionEvent(TASK_ID, pipeline, stage, error);
taskManager.localListener.onPipelineError(event);
verify(task, times(1)).setPipelineStatus(PipelineExecutorTask.Status.ERROR);
verify(task, times(1)).setPipelineError(pipelineExecutorErrorCaptor.capture());
assertEquals(new PipelineExecutorError(ERROR_MESSAGE, error), pipelineExecutorErrorCaptor.getValue());
verifyExecutorRegistryUpdated(async);
verifyExternalListenersNotified(event);
}
Aggregations