Search in sources :

Example 1 with PipelineExecutorError

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());
    }
}
Also used : PipelineExecutorError(org.guvnor.ala.pipeline.execution.PipelineExecutorError)

Example 2 with PipelineExecutorError

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());
    }
}
Also used : PipelineExecutorError(org.guvnor.ala.pipeline.execution.PipelineExecutorError)

Example 3 with PipelineExecutorError

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);
}
Also used : PipelineExecutorError(org.guvnor.ala.pipeline.execution.PipelineExecutorError) OnErrorStageExecutionEvent(org.guvnor.ala.pipeline.events.OnErrorStageExecutionEvent)

Example 4 with PipelineExecutorError

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);
}
Also used : PipelineExecutorError(org.guvnor.ala.pipeline.execution.PipelineExecutorError) OnErrorPipelineExecutionEvent(org.guvnor.ala.pipeline.events.OnErrorPipelineExecutionEvent)

Aggregations

PipelineExecutorError (org.guvnor.ala.pipeline.execution.PipelineExecutorError)4 OnErrorPipelineExecutionEvent (org.guvnor.ala.pipeline.events.OnErrorPipelineExecutionEvent)1 OnErrorStageExecutionEvent (org.guvnor.ala.pipeline.events.OnErrorStageExecutionEvent)1