Search in sources :

Example 21 with SubWorkflow

use of com.netflix.conductor.core.execution.tasks.SubWorkflow in project conductor by Netflix.

the class WorkflowExecutor method findLastFailedSubWorkflow.

private Workflow findLastFailedSubWorkflow(Task task, Workflow parentWorkflow) {
    if (SUB_WORKFLOW.name().equals(task.getTaskType()) && findLastFailedOrTimeOutTask(task)) {
        Workflow subWorkflow = executionDAOFacade.getWorkflowById(task.getSubWorkflowId(), true);
        Optional<Task> lTask = subWorkflow.getTasks().stream().filter(this::findLastFailedOrTimeOutTask).findFirst();
        return findLastFailedSubWorkflow(lTask.get(), subWorkflow);
    }
    return parentWorkflow;
}
Also used : Task(com.netflix.conductor.common.metadata.tasks.Task) WorkflowSystemTask(com.netflix.conductor.core.execution.tasks.WorkflowSystemTask) WorkflowTask(com.netflix.conductor.common.metadata.workflow.WorkflowTask) SubWorkflow(com.netflix.conductor.core.execution.tasks.SubWorkflow) Workflow(com.netflix.conductor.common.run.Workflow)

Aggregations

SubWorkflow (com.netflix.conductor.core.execution.tasks.SubWorkflow)21 Task (com.netflix.conductor.common.metadata.tasks.Task)20 WorkflowTask (com.netflix.conductor.common.metadata.workflow.WorkflowTask)19 Workflow (com.netflix.conductor.common.run.Workflow)19 Test (org.junit.Test)16 UserTask (com.netflix.conductor.tests.utils.UserTask)13 HashMap (java.util.HashMap)13 WorkflowDef (com.netflix.conductor.common.metadata.workflow.WorkflowDef)12 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)8 TaskResult (com.netflix.conductor.common.metadata.tasks.TaskResult)8 RerunWorkflowRequest (com.netflix.conductor.common.metadata.workflow.RerunWorkflowRequest)8 SubWorkflowParams (com.netflix.conductor.common.metadata.workflow.SubWorkflowParams)8 JsonMapperProvider (com.netflix.conductor.common.utils.JsonMapperProvider)8 Uninterruptibles (com.google.common.util.concurrent.Uninterruptibles)7 PollData (com.netflix.conductor.common.metadata.tasks.PollData)7 Status (com.netflix.conductor.common.metadata.tasks.Task.Status)7 COMPLETED (com.netflix.conductor.common.metadata.tasks.Task.Status.COMPLETED)7 COMPLETED_WITH_ERRORS (com.netflix.conductor.common.metadata.tasks.Task.Status.COMPLETED_WITH_ERRORS)7 FAILED (com.netflix.conductor.common.metadata.tasks.Task.Status.FAILED)7 IN_PROGRESS (com.netflix.conductor.common.metadata.tasks.Task.Status.IN_PROGRESS)7