Skip to content

Commit

Permalink
Merge pull request #149 from orkes-io/jump_task_changes
Browse files Browse the repository at this point in the history
Jump task changes
  • Loading branch information
manan164 authored Oct 11, 2023
2 parents a53016b + 11c2a17 commit 61ccd9b
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 57 deletions.
3 changes: 2 additions & 1 deletion src/main/java/io/orkes/conductor/client/WorkflowClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.netflix.conductor.common.run.WorkflowTestRequest;

import io.orkes.conductor.client.http.ApiException;
import io.orkes.conductor.client.model.JumpWorkflowExecutionRequest;
import io.orkes.conductor.client.model.WorkflowStatus;
import io.orkes.conductor.common.model.WorkflowRun;

Expand Down Expand Up @@ -92,7 +93,7 @@ public abstract Map<String, List<Workflow>> getWorkflowsByNamesAndCorrelationIds
*/
public abstract Workflow updateVariables(String workflowId, Map<String, Object> variables);

public abstract void jumpToTask(String workflowId, String taskReferenceName, Map<String, Object> input);
public abstract void jumpToTask(String workflowId, JumpWorkflowExecutionRequest jumpWorkflowExecutionRequest);

public abstract void upgradeRunningWorkflow(String workflowId, UpgradeWorkflowRequest body);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
import java.util.UUID;
import java.util.concurrent.*;

import com.netflix.conductor.common.metadata.workflow.UpgradeWorkflowRequest;
import com.netflix.conductor.common.metadata.workflow.*;
import io.orkes.conductor.client.model.JumpWorkflowExecutionRequest;
import org.apache.commons.lang.StringUtils;

import com.netflix.conductor.common.metadata.workflow.RerunWorkflowRequest;
import com.netflix.conductor.common.metadata.workflow.SkipTaskRequest;
import com.netflix.conductor.common.metadata.workflow.StartWorkflowRequest;
import com.netflix.conductor.common.model.BulkResponse;
import com.netflix.conductor.common.run.SearchResult;
import com.netflix.conductor.common.run.Workflow;
Expand Down Expand Up @@ -345,8 +343,8 @@ public void shutdown() {
}

@Override
public void jumpToTask(String workflowId, String taskReferenceName, Map<String, Object> input) {
httpClient.jumpToTaskWithHttpInfo(workflowId, taskReferenceName, input);
public void jumpToTask(String workflowId, JumpWorkflowExecutionRequest jumpWorkflowExecutionRequest) {
httpClient.jumpToTaskWithHttpInfo(jumpWorkflowExecutionRequest, workflowId);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
import java.util.List;
import java.util.Map;

import com.netflix.conductor.common.metadata.workflow.RerunWorkflowRequest;
import com.netflix.conductor.common.metadata.workflow.SkipTaskRequest;
import com.netflix.conductor.common.metadata.workflow.StartWorkflowRequest;
import com.netflix.conductor.common.metadata.workflow.UpgradeWorkflowRequest;
import com.netflix.conductor.common.metadata.workflow.*;
import com.netflix.conductor.common.run.Workflow;
import com.netflix.conductor.common.run.WorkflowTestRequest;

Expand Down Expand Up @@ -3836,68 +3833,24 @@ private Call updateVariablesCall(String workflowId, Map<String, Object> variable
null);
}

/**
* Jump workflow execution to given task
* Jump workflow execution to given task.
* @param body (required)
* @param workflowId (required)
* @param taskReferenceName (optional)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void jumpToTask(Map<String, Object> body, String workflowId, String taskReferenceName) throws ApiException {
jumpToTaskWithHttpInfo(workflowId, taskReferenceName, body);
}

/**
* Jump workflow execution to given task
* Jump workflow execution to given task.
* @param input (required)
* @param workflowId (required)
* @param taskReferenceName (optional)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> jumpToTaskWithHttpInfo(String workflowId, String taskReferenceName, Map<String, Object> input) throws ApiException {
com.squareup.okhttp.Call call = jumpToTaskValidateBeforeCall(input, workflowId, taskReferenceName, null, null);
return apiClient.execute(call);
}

@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call jumpToTaskValidateBeforeCall(Map<String, Object> body, String workflowId, String taskReferenceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'input' when calling jumpToTask(Async)");
}
// verify the required parameter 'workflowId' is set
if (workflowId == null) {
throw new ApiException("Missing the required parameter 'workflowId' when calling jumpToTask(Async)");
}

com.squareup.okhttp.Call call = jumpToTaskCall(body, workflowId, taskReferenceName, progressListener, progressRequestListener);
return call;
}

/**
* Build call for jumpToTask
* @param body (required)
* @param workflowId (required)
* @param taskReferenceName (optional)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call jumpToTaskCall(Map<String, Object> body, String workflowId, String taskReferenceName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
public com.squareup.okhttp.Call jumpToTaskCall(JumpWorkflowExecutionRequest body, String workflowId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;

// create path and map variables
String localVarPath = "/workflow/{workflowId}/jump/{taskReferenceName}"
String localVarPath = "/workflow/{workflowId}/jump"
.replaceAll("\\{" + "workflowId" + "\\}", apiClient.escapeString(workflowId.toString()));

List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
if (taskReferenceName != null)
localVarQueryParams.addAll(apiClient.parameterToPair("taskReferenceName", taskReferenceName));

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Expand Down Expand Up @@ -3931,6 +3884,44 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}

@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call jumpToTaskValidateBeforeCall(JumpWorkflowExecutionRequest body, String workflowId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling jumpToTask(Async)");
}
// verify the required parameter 'workflowId' is set
if (workflowId == null) {
throw new ApiException("Missing the required parameter 'workflowId' when calling jumpToTask(Async)");
}

com.squareup.okhttp.Call call = jumpToTaskCall(body, workflowId, progressListener, progressRequestListener);
return call;
}

/**
* Jump workflow execution to given task
* Jump workflow execution to given task.
* @param body (required)
* @param workflowId (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void jumpToTask(JumpWorkflowExecutionRequest body, String workflowId) throws ApiException {
jumpToTaskWithHttpInfo(body, workflowId);
}

/**
* Jump workflow execution to given task
* Jump workflow execution to given task.
* @param body (required)
* @param workflowId (required)
* @return ApiResponse&lt;Void&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Void> jumpToTaskWithHttpInfo(JumpWorkflowExecutionRequest body, String workflowId) throws ApiException {
com.squareup.okhttp.Call call = jumpToTaskValidateBeforeCall(body, workflowId, null, null);
return apiClient.execute(call);
}
/**
* Upgrade running workflow to newer version
* Upgrade running workflow to newer version
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package io.orkes.conductor.client.model;

import java.util.Map;

public class JumpWorkflowExecutionRequest {

public Map<String, Object> getSkippedTasksOutput() {
return skippedTasksOutput;
}

public void setSkippedTasksOutput(Map<String, Object> skippedTasksOutput) {
this.skippedTasksOutput = skippedTasksOutput;
}

public Map<String, Object> getJumpTaskInput() {
return jumpTaskInput;
}

public void setJumpTaskInput(Map<String, Object> jumpTaskInput) {
this.jumpTaskInput = jumpTaskInput;
}

public String getTaskReferenceName() {
return taskReferenceName;
}

public void setTaskReferenceName(String taskReferenceName) {
this.taskReferenceName = taskReferenceName;
}
private Map<String, Object> skippedTasksOutput;

private Map<String, Object> jumpTaskInput;

private String taskReferenceName;

}

0 comments on commit 61ccd9b

Please sign in to comment.