Skip to content

Commit

Permalink
Merge pull request #142 from orkes-io/jump_task_api
Browse files Browse the repository at this point in the history
Jump task api
  • Loading branch information
manan164 authored Aug 17, 2023
2 parents b9c5234 + e46abb7 commit ff8393a
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ public void shutdown() {
}
}

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

@Override
public void close() {
shutdown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3834,4 +3834,100 @@ private Call updateVariablesCall(String workflowId, Map<String, Object> variable
localVarAuthNames,
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 {
Object localVarPostBody = body;

// create path and map variables
String localVarPath = "/workflow/{workflowId}/jump/{taskReferenceName}"
.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>();

Map<String, Object> localVarFormParams = new HashMap<String, Object>();

final String[] localVarAccepts = {

};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);

if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}

String[] localVarAuthNames = new String[] { "api_key" };
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}

}

0 comments on commit ff8393a

Please sign in to comment.