Search in sources :

Example 1 with BulkResponse

use of com.netflix.conductor.service.common.BulkResponse in project conductor by Netflix.

the class WorkflowBulkServiceImpl method restart.

/**
 * Restart the list of workflows.
 *
 * @param workflowIds          - list of workflow Ids  to perform restart operation on
 * @param useLatestDefinitions if true, use latest workflow and task definitions upon restart
 * @return bulk response object containing a list of succeeded workflows and a list of failed ones with errors
 */
@Service
public BulkResponse restart(List<String> workflowIds, boolean useLatestDefinitions) {
    BulkResponse bulkResponse = new BulkResponse();
    for (String workflowId : workflowIds) {
        try {
            workflowExecutor.rewind(workflowId, useLatestDefinitions);
            bulkResponse.appendSuccessResponse(workflowId);
        } catch (Exception e) {
            LOGGER.error("bulk restart exception, workflowId {}, message: {} ", workflowId, e.getMessage(), e);
            bulkResponse.appendFailedResponse(workflowId, e.getMessage());
        }
    }
    return bulkResponse;
}
Also used : BulkResponse(com.netflix.conductor.service.common.BulkResponse) Service(com.netflix.conductor.annotations.Service)

Example 2 with BulkResponse

use of com.netflix.conductor.service.common.BulkResponse in project conductor by Netflix.

the class WorkflowBulkServiceImpl method retry.

/**
 * Retry the last failed task for each workflow from the list.
 * @param workflowIds - list of workflow Ids  to perform retry operation on
 * @return bulk response object containing a list of succeeded workflows and a list of failed ones with errors
 */
@Service
public BulkResponse retry(List<String> workflowIds) {
    BulkResponse bulkResponse = new BulkResponse();
    for (String workflowId : workflowIds) {
        try {
            workflowExecutor.retry(workflowId, false);
            bulkResponse.appendSuccessResponse(workflowId);
        } catch (Exception e) {
            LOGGER.error("bulk retry exception, workflowId {}, message: {} ", workflowId, e.getMessage(), e);
            bulkResponse.appendFailedResponse(workflowId, e.getMessage());
        }
    }
    return bulkResponse;
}
Also used : BulkResponse(com.netflix.conductor.service.common.BulkResponse) Service(com.netflix.conductor.annotations.Service)

Example 3 with BulkResponse

use of com.netflix.conductor.service.common.BulkResponse in project conductor by Netflix.

the class WorkflowBulkServiceImpl method terminate.

/**
 * Terminate workflows execution.
 * @param workflowIds - list of workflow Ids  to perform terminate operation on
 * @param reason - description to be specified for the terminated workflow for future references.
 * @return bulk response object containing a list of succeeded workflows and a list of failed ones with errors
 */
@Service
public BulkResponse terminate(List<String> workflowIds, String reason) {
    BulkResponse bulkResponse = new BulkResponse();
    for (String workflowId : workflowIds) {
        try {
            workflowExecutor.terminateWorkflow(workflowId, reason);
            bulkResponse.appendSuccessResponse(workflowId);
        } catch (Exception e) {
            LOGGER.error("bulk terminate exception, workflowId {}, message: {} ", workflowId, e.getMessage(), e);
            bulkResponse.appendFailedResponse(workflowId, e.getMessage());
        }
    }
    return bulkResponse;
}
Also used : BulkResponse(com.netflix.conductor.service.common.BulkResponse) Service(com.netflix.conductor.annotations.Service)

Example 4 with BulkResponse

use of com.netflix.conductor.service.common.BulkResponse in project conductor by Netflix.

the class WorkflowBulkServiceImpl method resumeWorkflow.

/**
 * Resume the list of workflows.
 * @param workflowIds - list of workflow Ids  to perform resume operation on
 * @return bulk response object containing a list of succeeded workflows and a list of failed ones with errors
 */
@Service
public BulkResponse resumeWorkflow(List<String> workflowIds) {
    BulkResponse bulkResponse = new BulkResponse();
    for (String workflowId : workflowIds) {
        try {
            workflowExecutor.resumeWorkflow(workflowId);
            bulkResponse.appendSuccessResponse(workflowId);
        } catch (Exception e) {
            LOGGER.error("bulk resumeWorkflow exception, workflowId {}, message: {} ", workflowId, e.getMessage(), e);
            bulkResponse.appendFailedResponse(workflowId, e.getMessage());
        }
    }
    return bulkResponse;
}
Also used : BulkResponse(com.netflix.conductor.service.common.BulkResponse) Service(com.netflix.conductor.annotations.Service)

Example 5 with BulkResponse

use of com.netflix.conductor.service.common.BulkResponse in project conductor by Netflix.

the class WorkflowBulkServiceImpl method pauseWorkflow.

/**
 * Pause the list of workflows.
 * @param workflowIds - list of workflow Ids  to perform pause operation on
 * @return bulk response object containing a list of succeeded workflows and a list of failed ones with errors
 */
@Service
public BulkResponse pauseWorkflow(List<String> workflowIds) {
    BulkResponse bulkResponse = new BulkResponse();
    for (String workflowId : workflowIds) {
        try {
            workflowExecutor.pauseWorkflow(workflowId);
            bulkResponse.appendSuccessResponse(workflowId);
        } catch (Exception e) {
            LOGGER.error("bulk pauseWorkflow exception, workflowId {}, message: {} ", workflowId, e.getMessage(), e);
            bulkResponse.appendFailedResponse(workflowId, e.getMessage());
        }
    }
    return bulkResponse;
}
Also used : BulkResponse(com.netflix.conductor.service.common.BulkResponse) Service(com.netflix.conductor.annotations.Service)

Aggregations

Service (com.netflix.conductor.annotations.Service)5 BulkResponse (com.netflix.conductor.service.common.BulkResponse)5