Skip to content

Commit

Permalink
updated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Shailesh Jagannath Padave committed Nov 18, 2024
1 parent d9b623b commit 5864006
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

import java.util.List;

import com.netflix.conductor.model.WorkflowModel;
import org.springframework.validation.annotation.Validated;

import com.netflix.conductor.common.model.BulkResponse;
import com.netflix.conductor.model.WorkflowModel;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import java.util.List;

import com.netflix.conductor.model.WorkflowModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
Expand All @@ -23,6 +22,7 @@
import com.netflix.conductor.annotations.Trace;
import com.netflix.conductor.common.model.BulkResponse;
import com.netflix.conductor.core.execution.WorkflowExecutor;
import com.netflix.conductor.model.WorkflowModel;

@Audit
@Trace
Expand All @@ -44,7 +44,7 @@ public WorkflowBulkServiceImpl(
*
* @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
* ones with errors
*/
public BulkResponse<String> pauseWorkflow(List<String> workflowIds) {

Expand All @@ -71,7 +71,7 @@ public BulkResponse<String> pauseWorkflow(List<String> workflowIds) {
*
* @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
* ones with errors
*/
public BulkResponse<String> resumeWorkflow(List<String> workflowIds) {
BulkResponse<String> bulkResponse = new BulkResponse<>();
Expand All @@ -94,10 +94,10 @@ public BulkResponse<String> resumeWorkflow(List<String> workflowIds) {
/**
* Restart the list of workflows.
*
* @param workflowIds - list of workflow Ids to perform restart operation on
* @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
* ones with errors
*/
public BulkResponse<String> restart(List<String> workflowIds, boolean useLatestDefinitions) {
BulkResponse<String> bulkResponse = new BulkResponse<>();
Expand All @@ -122,7 +122,7 @@ public BulkResponse<String> restart(List<String> workflowIds, boolean useLatestD
*
* @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
* ones with errors
*/
public BulkResponse<String> retry(List<String> workflowIds) {
BulkResponse<String> bulkResponse = new BulkResponse<>();
Expand All @@ -146,10 +146,10 @@ public BulkResponse<String> retry(List<String> workflowIds) {
* 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.
* @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
* ones with errors
*/
public BulkResponse<String> terminate(List<String> workflowIds, String reason) {
BulkResponse<String> bulkResponse = new BulkResponse<>();
Expand All @@ -172,7 +172,7 @@ public BulkResponse<String> terminate(List<String> workflowIds, String reason) {
/**
* Removes a list of workflows from the system.
*
* @param workflowIds List of WorkflowIDs of the workflows you want to remove from system.
* @param workflowIds List of WorkflowIDs of the workflows you want to remove from system.
* @param archiveWorkflow Archives the workflow and associated tasks instead of removing them.
*/
public BulkResponse<String> deleteWorkflow(List<String> workflowIds, boolean archiveWorkflow) {
Expand All @@ -198,11 +198,11 @@ public BulkResponse<String> deleteWorkflow(List<String> workflowIds, boolean arc
/**
* Terminates execution for workflows in a list, then removes each workflow.
*
* @param workflowIds List of workflow IDs to terminate and delete.
* @param reason Reason for terminating the workflow.
* @param workflowIds List of workflow IDs to terminate and delete.
* @param reason Reason for terminating the workflow.
* @param archiveWorkflow Archives the workflow and associated tasks instead of removing them.
* @return bulk response object containing a list of succeeded workflows and a list of failed
* ones with errors
* ones with errors
*/
public BulkResponse<String> terminateRemove(
List<String> workflowIds, String reason, boolean archiveWorkflow) {
Expand Down Expand Up @@ -238,16 +238,18 @@ public BulkResponse<String> terminateRemove(
/**
* Fetch workflow details for given workflowIds.
*
* @param workflowIds List of workflow IDs to terminate and delete.
* @param workflowIds List of workflow IDs to terminate and delete.
* @param includeTasks includes tasks from workflow
* @return bulk response object containing a list of workflow details
*/
@Override
public BulkResponse<WorkflowModel> searchWorkflow(List<String> workflowIds, boolean includeTasks) {
public BulkResponse<WorkflowModel> searchWorkflow(
List<String> workflowIds, boolean includeTasks) {
BulkResponse<WorkflowModel> bulkResponse = new BulkResponse<>();
for (String workflowId : workflowIds) {
try {
WorkflowModel workflowModel = workflowExecutor.getWorkflow(workflowId, includeTasks);
WorkflowModel workflowModel =
workflowExecutor.getWorkflow(workflowId, includeTasks);
bulkResponse.appendSuccessResponse(workflowModel);
} catch (Exception e) {
LOGGER.error(
Expand All @@ -260,6 +262,4 @@ public BulkResponse<WorkflowModel> searchWorkflow(List<String> workflowIds, bool
}
return bulkResponse;
}


}

0 comments on commit 5864006

Please sign in to comment.