|
@@ -0,0 +1,3769 @@
|
|
|
+/*
|
|
|
+ * KIE Server
|
|
|
+ * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
|
+ *
|
|
|
+ * OpenAPI spec version: 7.0
|
|
|
+ *
|
|
|
+ *
|
|
|
+ * NOTE: This class is auto generated by the swagger code generator program.
|
|
|
+ * https://github.com/swagger-api/swagger-codegen.git
|
|
|
+ * Do not edit the class manually.
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+package net.p0f.samples.rhpam_fuse_integration.rhpam.api;
|
|
|
+
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.invoke.ApiCallback;
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.invoke.ApiClient;
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.invoke.ApiException;
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.invoke.ApiResponse;
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.invoke.Configuration;
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.invoke.Pair;
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.invoke.ProgressRequestBody;
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.invoke.ProgressResponseBody;
|
|
|
+
|
|
|
+import com.google.gson.reflect.TypeToken;
|
|
|
+
|
|
|
+import java.io.IOException;
|
|
|
+
|
|
|
+
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.model.NodeInstanceList;
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.model.ProcessDefinitions;
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.model.ProcessInstance;
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.model.ProcessInstanceList;
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.model.VariableInstanceList;
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.model.WorkItemInstance;
|
|
|
+import net.p0f.samples.rhpam_fuse_integration.rhpam.model.WorkItemInstanceList;
|
|
|
+
|
|
|
+import java.lang.reflect.Type;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+// XXX Due to missing swagger.json authentication info, every single instance of XXX
|
|
|
+// XXX String[] localVarAuthNames = new String[] { }; must be replaced with XXX
|
|
|
+// XXX String[] localVarAuthNames = new String[] { "basicAuth" }; matching the XXX
|
|
|
+// XXX authentication configured in ApiClient. Unfortunately, the same for all XXX
|
|
|
+// XXX other generated API classes. XXX
|
|
|
+public class ProcessInstancesApi {
|
|
|
+ private ApiClient apiClient;
|
|
|
+
|
|
|
+ public ProcessInstancesApi() {
|
|
|
+ this(Configuration.getDefaultApiClient());
|
|
|
+ }
|
|
|
+
|
|
|
+ public ProcessInstancesApi(ApiClient apiClient) {
|
|
|
+ this.apiClient = apiClient;
|
|
|
+ }
|
|
|
+
|
|
|
+ public ApiClient getApiClient() {
|
|
|
+ return apiClient;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setApiClient(ApiClient apiClient) {
|
|
|
+ this.apiClient = apiClient;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Build call for abortProcessInstance
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be aborted (required)
|
|
|
+ * @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 abortProcessInstanceCall(String containerId, Long processInstanceId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call abortProcessInstanceValidateBeforeCall(String containerId, Long processInstanceId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling abortProcessInstance(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling abortProcessInstance(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = abortProcessInstanceCall(containerId, processInstanceId, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Aborts a specified process instance in a specified KIE container.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be aborted (required)
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public void abortProcessInstance(String containerId, Long processInstanceId) throws ApiException {
|
|
|
+ abortProcessInstanceWithHttpInfo(containerId, processInstanceId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Aborts a specified process instance in a specified KIE container.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be aborted (required)
|
|
|
+ * @return ApiResponse<Void>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Void> abortProcessInstanceWithHttpInfo(String containerId, Long processInstanceId) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = abortProcessInstanceValidateBeforeCall(containerId, processInstanceId, null, null);
|
|
|
+ return apiClient.execute(call);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Aborts a specified process instance in a specified KIE container. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be aborted (required)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call abortProcessInstanceAsync(String containerId, Long processInstanceId, final ApiCallback<Void> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = abortProcessInstanceValidateBeforeCall(containerId, processInstanceId, progressListener, progressRequestListener);
|
|
|
+ apiClient.executeAsync(call, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for abortProcessInstances
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param instanceId list of identifiers of the process instances to be aborted (required)
|
|
|
+ * @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 abortProcessInstancesCall(String containerId, List<Long> instanceId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+ if (instanceId != null)
|
|
|
+ localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "instanceId", instanceId));
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call abortProcessInstancesValidateBeforeCall(String containerId, List<Long> instanceId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling abortProcessInstances(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'instanceId' is set
|
|
|
+ if (instanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'instanceId' when calling abortProcessInstances(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = abortProcessInstancesCall(containerId, instanceId, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Aborts multiple specified process instances in a specified KIE container.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param instanceId list of identifiers of the process instances to be aborted (required)
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public void abortProcessInstances(String containerId, List<Long> instanceId) throws ApiException {
|
|
|
+ abortProcessInstancesWithHttpInfo(containerId, instanceId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Aborts multiple specified process instances in a specified KIE container.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param instanceId list of identifiers of the process instances to be aborted (required)
|
|
|
+ * @return ApiResponse<Void>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Void> abortProcessInstancesWithHttpInfo(String containerId, List<Long> instanceId) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = abortProcessInstancesValidateBeforeCall(containerId, instanceId, null, null);
|
|
|
+ return apiClient.execute(call);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Aborts multiple specified process instances in a specified KIE container. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param instanceId list of identifiers of the process instances to be aborted (required)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call abortProcessInstancesAsync(String containerId, List<Long> instanceId, final ApiCallback<Void> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = abortProcessInstancesValidateBeforeCall(containerId, instanceId, progressListener, progressRequestListener);
|
|
|
+ apiClient.executeAsync(call, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for abortWorkItem
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work item belongs to (required)
|
|
|
+ * @param workItemId identifier of the work item to abort (required)
|
|
|
+ * @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 abortWorkItemCall(String containerId, Long processInstanceId, Long workItemId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}/workitems/{workItemId}/aborted"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()))
|
|
|
+ .replaceAll("\\{" + "workItemId" + "\\}", apiClient.escapeString(workItemId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call abortWorkItemValidateBeforeCall(String containerId, Long processInstanceId, Long workItemId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling abortWorkItem(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling abortWorkItem(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'workItemId' is set
|
|
|
+ if (workItemId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'workItemId' when calling abortWorkItem(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = abortWorkItemCall(containerId, processInstanceId, workItemId, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Aborts a specified work item for a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work item belongs to (required)
|
|
|
+ * @param workItemId identifier of the work item to abort (required)
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public void abortWorkItem(String containerId, Long processInstanceId, Long workItemId) throws ApiException {
|
|
|
+ abortWorkItemWithHttpInfo(containerId, processInstanceId, workItemId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Aborts a specified work item for a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work item belongs to (required)
|
|
|
+ * @param workItemId identifier of the work item to abort (required)
|
|
|
+ * @return ApiResponse<Void>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Void> abortWorkItemWithHttpInfo(String containerId, Long processInstanceId, Long workItemId) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = abortWorkItemValidateBeforeCall(containerId, processInstanceId, workItemId, null, null);
|
|
|
+ return apiClient.execute(call);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Aborts a specified work item for a specified process instance. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work item belongs to (required)
|
|
|
+ * @param workItemId identifier of the work item to abort (required)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call abortWorkItemAsync(String containerId, Long processInstanceId, Long workItemId, final ApiCallback<Void> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = abortWorkItemValidateBeforeCall(containerId, processInstanceId, workItemId, progressListener, progressRequestListener);
|
|
|
+ apiClient.executeAsync(call, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for completeWorkItem
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work item belongs to (required)
|
|
|
+ * @param workItemId identifier of the work item to complete (required)
|
|
|
+ * @param body optional outcome data give as map (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 completeWorkItemCall(String containerId, Long processInstanceId, Long workItemId, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = body;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}/workitems/{workItemId}/completed"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()))
|
|
|
+ .replaceAll("\\{" + "workItemId" + "\\}", apiClient.escapeString(workItemId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call completeWorkItemValidateBeforeCall(String containerId, Long processInstanceId, Long workItemId, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling completeWorkItem(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling completeWorkItem(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'workItemId' is set
|
|
|
+ if (workItemId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'workItemId' when calling completeWorkItem(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = completeWorkItemCall(containerId, processInstanceId, workItemId, body, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Completes a specified work item for a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work item belongs to (required)
|
|
|
+ * @param workItemId identifier of the work item to complete (required)
|
|
|
+ * @param body optional outcome data give as map (optional)
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public void completeWorkItem(String containerId, Long processInstanceId, Long workItemId, String body) throws ApiException {
|
|
|
+ completeWorkItemWithHttpInfo(containerId, processInstanceId, workItemId, body);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Completes a specified work item for a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work item belongs to (required)
|
|
|
+ * @param workItemId identifier of the work item to complete (required)
|
|
|
+ * @param body optional outcome data give as map (optional)
|
|
|
+ * @return ApiResponse<Void>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Void> completeWorkItemWithHttpInfo(String containerId, Long processInstanceId, Long workItemId, String body) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = completeWorkItemValidateBeforeCall(containerId, processInstanceId, workItemId, body, null, null);
|
|
|
+ return apiClient.execute(call);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Completes a specified work item for a specified process instance. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work item belongs to (required)
|
|
|
+ * @param workItemId identifier of the work item to complete (required)
|
|
|
+ * @param body optional outcome data give as map (optional)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call completeWorkItemAsync(String containerId, Long processInstanceId, Long workItemId, String body, final ApiCallback<Void> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = completeWorkItemValidateBeforeCall(containerId, processInstanceId, workItemId, body, progressListener, progressRequestListener);
|
|
|
+ apiClient.executeAsync(call, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for getAvailableSignals
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that signals should be collected for (required)
|
|
|
+ * @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 getAvailableSignalsCall(String containerId, Long processInstanceId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}/signals"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call getAvailableSignalsValidateBeforeCall(String containerId, Long processInstanceId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling getAvailableSignals(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling getAvailableSignals(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getAvailableSignalsCall(containerId, processInstanceId, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns all available signal names for a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that signals should be collected for (required)
|
|
|
+ * @return List<String>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public List<String> getAvailableSignals(String containerId, Long processInstanceId) throws ApiException {
|
|
|
+ ApiResponse<List<String>> resp = getAvailableSignalsWithHttpInfo(containerId, processInstanceId);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns all available signal names for a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that signals should be collected for (required)
|
|
|
+ * @return ApiResponse<List<String>>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<List<String>> getAvailableSignalsWithHttpInfo(String containerId, Long processInstanceId) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = getAvailableSignalsValidateBeforeCall(containerId, processInstanceId, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns all available signal names for a specified process instance. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that signals should be collected for (required)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call getAvailableSignalsAsync(String containerId, Long processInstanceId, final ApiCallback<List<String>> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getAvailableSignalsValidateBeforeCall(containerId, processInstanceId, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<List<String>>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for getProcessInstance
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be fetched (required)
|
|
|
+ * @param withVars indicates if process instance variables should be loaded or not (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 getProcessInstanceCall(String containerId, Long processInstanceId, Boolean withVars, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+ if (withVars != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("withVars", withVars));
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call getProcessInstanceValidateBeforeCall(String containerId, Long processInstanceId, Boolean withVars, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling getProcessInstance(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling getProcessInstance(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstanceCall(containerId, processInstanceId, withVars, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns information about a specified process instance in a specified KIE container.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be fetched (required)
|
|
|
+ * @param withVars indicates if process instance variables should be loaded or not (optional)
|
|
|
+ * @return ProcessInstance
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ProcessInstance getProcessInstance(String containerId, Long processInstanceId, Boolean withVars) throws ApiException {
|
|
|
+ ApiResponse<ProcessInstance> resp = getProcessInstanceWithHttpInfo(containerId, processInstanceId, withVars);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns information about a specified process instance in a specified KIE container.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be fetched (required)
|
|
|
+ * @param withVars indicates if process instance variables should be loaded or not (optional)
|
|
|
+ * @return ApiResponse<ProcessInstance>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<ProcessInstance> getProcessInstanceWithHttpInfo(String containerId, Long processInstanceId, Boolean withVars) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstanceValidateBeforeCall(containerId, processInstanceId, withVars, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<ProcessInstance>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns information about a specified process instance in a specified KIE container. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be fetched (required)
|
|
|
+ * @param withVars indicates if process instance variables should be loaded or not (optional)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call getProcessInstanceAsync(String containerId, Long processInstanceId, Boolean withVars, final ApiCallback<ProcessInstance> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstanceValidateBeforeCall(containerId, processInstanceId, withVars, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<ProcessInstance>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for getProcessInstanceHistory
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that history should be collected for (required)
|
|
|
+ * @param activeOnly instructs if active nodes only should be collected, defaults to false (optional)
|
|
|
+ * @param completedOnly instructs if completed nodes only should be collected, defaults to false (optional)
|
|
|
+ * @param processInstanceHistoryType entry type from the history (optional)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @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 getProcessInstanceHistoryCall(String containerId, Long processInstanceId, Boolean activeOnly, Boolean completedOnly, String processInstanceHistoryType, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}/nodes/instances"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+ if (activeOnly != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("activeOnly", activeOnly));
|
|
|
+ if (completedOnly != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("completedOnly", completedOnly));
|
|
|
+ if (processInstanceHistoryType != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("processInstanceHistoryType", processInstanceHistoryType));
|
|
|
+ if (page != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
|
|
|
+ if (pageSize != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize));
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call getProcessInstanceHistoryValidateBeforeCall(String containerId, Long processInstanceId, Boolean activeOnly, Boolean completedOnly, String processInstanceHistoryType, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling getProcessInstanceHistory(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling getProcessInstanceHistory(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstanceHistoryCall(containerId, processInstanceId, activeOnly, completedOnly, processInstanceHistoryType, page, pageSize, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns node instances for the specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that history should be collected for (required)
|
|
|
+ * @param activeOnly instructs if active nodes only should be collected, defaults to false (optional)
|
|
|
+ * @param completedOnly instructs if completed nodes only should be collected, defaults to false (optional)
|
|
|
+ * @param processInstanceHistoryType entry type from the history (optional)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @return NodeInstanceList
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public NodeInstanceList getProcessInstanceHistory(String containerId, Long processInstanceId, Boolean activeOnly, Boolean completedOnly, String processInstanceHistoryType, Integer page, Integer pageSize) throws ApiException {
|
|
|
+ ApiResponse<NodeInstanceList> resp = getProcessInstanceHistoryWithHttpInfo(containerId, processInstanceId, activeOnly, completedOnly, processInstanceHistoryType, page, pageSize);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns node instances for the specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that history should be collected for (required)
|
|
|
+ * @param activeOnly instructs if active nodes only should be collected, defaults to false (optional)
|
|
|
+ * @param completedOnly instructs if completed nodes only should be collected, defaults to false (optional)
|
|
|
+ * @param processInstanceHistoryType entry type from the history (optional)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @return ApiResponse<NodeInstanceList>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<NodeInstanceList> getProcessInstanceHistoryWithHttpInfo(String containerId, Long processInstanceId, Boolean activeOnly, Boolean completedOnly, String processInstanceHistoryType, Integer page, Integer pageSize) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstanceHistoryValidateBeforeCall(containerId, processInstanceId, activeOnly, completedOnly, processInstanceHistoryType, page, pageSize, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<NodeInstanceList>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns node instances for the specified process instance. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that history should be collected for (required)
|
|
|
+ * @param activeOnly instructs if active nodes only should be collected, defaults to false (optional)
|
|
|
+ * @param completedOnly instructs if completed nodes only should be collected, defaults to false (optional)
|
|
|
+ * @param processInstanceHistoryType entry type from the history (optional)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call getProcessInstanceHistoryAsync(String containerId, Long processInstanceId, Boolean activeOnly, Boolean completedOnly, String processInstanceHistoryType, Integer page, Integer pageSize, final ApiCallback<NodeInstanceList> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstanceHistoryValidateBeforeCall(containerId, processInstanceId, activeOnly, completedOnly, processInstanceHistoryType, page, pageSize, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<NodeInstanceList>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for getProcessInstanceVariable
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variable should be retrieved from (required)
|
|
|
+ * @param varName variable name to be retrieved (required)
|
|
|
+ * @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 getProcessInstanceVariableCall(String containerId, Long processInstanceId, String varName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}/variable/{varName}"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()))
|
|
|
+ .replaceAll("\\{" + "varName" + "\\}", apiClient.escapeString(varName.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call getProcessInstanceVariableValidateBeforeCall(String containerId, Long processInstanceId, String varName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling getProcessInstanceVariable(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling getProcessInstanceVariable(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'varName' is set
|
|
|
+ if (varName == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'varName' when calling getProcessInstanceVariable(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstanceVariableCall(containerId, processInstanceId, varName, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the value of a specified variable in a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variable should be retrieved from (required)
|
|
|
+ * @param varName variable name to be retrieved (required)
|
|
|
+ * @return Object
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public Object getProcessInstanceVariable(String containerId, Long processInstanceId, String varName) throws ApiException {
|
|
|
+ ApiResponse<Object> resp = getProcessInstanceVariableWithHttpInfo(containerId, processInstanceId, varName);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the value of a specified variable in a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variable should be retrieved from (required)
|
|
|
+ * @param varName variable name to be retrieved (required)
|
|
|
+ * @return ApiResponse<Object>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Object> getProcessInstanceVariableWithHttpInfo(String containerId, Long processInstanceId, String varName) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstanceVariableValidateBeforeCall(containerId, processInstanceId, varName, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<Object>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the value of a specified variable in a specified process instance. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variable should be retrieved from (required)
|
|
|
+ * @param varName variable name to be retrieved (required)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call getProcessInstanceVariableAsync(String containerId, Long processInstanceId, String varName, final ApiCallback<Object> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstanceVariableValidateBeforeCall(containerId, processInstanceId, varName, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<Object>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for getProcessInstanceVariables
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variables should be retrieved from (required)
|
|
|
+ * @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 getProcessInstanceVariablesCall(String containerId, Long processInstanceId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}/variables"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call getProcessInstanceVariablesValidateBeforeCall(String containerId, Long processInstanceId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling getProcessInstanceVariables(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling getProcessInstanceVariables(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstanceVariablesCall(containerId, processInstanceId, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Retrieves all variables for a specified process instance as a map in which the key is the variable name and the value is the variable value.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variables should be retrieved from (required)
|
|
|
+ * @return Map<String, Object>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public Map<String, Object> getProcessInstanceVariables(String containerId, Long processInstanceId) throws ApiException {
|
|
|
+ ApiResponse<Map<String, Object>> resp = getProcessInstanceVariablesWithHttpInfo(containerId, processInstanceId);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Retrieves all variables for a specified process instance as a map in which the key is the variable name and the value is the variable value.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variables should be retrieved from (required)
|
|
|
+ * @return ApiResponse<Map<String, Object>>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Map<String, Object>> getProcessInstanceVariablesWithHttpInfo(String containerId, Long processInstanceId) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstanceVariablesValidateBeforeCall(containerId, processInstanceId, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<Map<String, Object>>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Retrieves all variables for a specified process instance as a map in which the key is the variable name and the value is the variable value. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variables should be retrieved from (required)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call getProcessInstanceVariablesAsync(String containerId, Long processInstanceId, final ApiCallback<Map<String, Object>> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstanceVariablesValidateBeforeCall(containerId, processInstanceId, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<Map<String, Object>>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for getProcessInstances
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the parent process instance that process instances should be collected for (required)
|
|
|
+ * @param status optional process instance status (active, completed, aborted) - defaults ot active (1) only (optional)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @param sort optional sort column, no default (optional)
|
|
|
+ * @param sortOrder optional sort direction (asc, desc) - defaults to asc (optional, default to true)
|
|
|
+ * @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 getProcessInstancesCall(String containerId, Long processInstanceId, List<Integer> status, Integer page, Integer pageSize, String sort, Boolean sortOrder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}/processes"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+ if (status != null)
|
|
|
+ localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "status", status));
|
|
|
+ if (page != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
|
|
|
+ if (pageSize != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize));
|
|
|
+ if (sort != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort));
|
|
|
+ if (sortOrder != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("sortOrder", sortOrder));
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call getProcessInstancesValidateBeforeCall(String containerId, Long processInstanceId, List<Integer> status, Integer page, Integer pageSize, String sort, Boolean sortOrder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling getProcessInstances(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling getProcessInstances(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstancesCall(containerId, processInstanceId, status, page, pageSize, sort, sortOrder, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns a list of process instances for which a specified process instance is a parent process instance
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the parent process instance that process instances should be collected for (required)
|
|
|
+ * @param status optional process instance status (active, completed, aborted) - defaults ot active (1) only (optional)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @param sort optional sort column, no default (optional)
|
|
|
+ * @param sortOrder optional sort direction (asc, desc) - defaults to asc (optional, default to true)
|
|
|
+ * @return ProcessInstanceList
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ProcessInstanceList getProcessInstances(String containerId, Long processInstanceId, List<Integer> status, Integer page, Integer pageSize, String sort, Boolean sortOrder) throws ApiException {
|
|
|
+ ApiResponse<ProcessInstanceList> resp = getProcessInstancesWithHttpInfo(containerId, processInstanceId, status, page, pageSize, sort, sortOrder);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns a list of process instances for which a specified process instance is a parent process instance
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the parent process instance that process instances should be collected for (required)
|
|
|
+ * @param status optional process instance status (active, completed, aborted) - defaults ot active (1) only (optional)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @param sort optional sort column, no default (optional)
|
|
|
+ * @param sortOrder optional sort direction (asc, desc) - defaults to asc (optional, default to true)
|
|
|
+ * @return ApiResponse<ProcessInstanceList>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<ProcessInstanceList> getProcessInstancesWithHttpInfo(String containerId, Long processInstanceId, List<Integer> status, Integer page, Integer pageSize, String sort, Boolean sortOrder) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstancesValidateBeforeCall(containerId, processInstanceId, status, page, pageSize, sort, sortOrder, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<ProcessInstanceList>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns a list of process instances for which a specified process instance is a parent process instance (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the parent process instance that process instances should be collected for (required)
|
|
|
+ * @param status optional process instance status (active, completed, aborted) - defaults ot active (1) only (optional)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @param sort optional sort column, no default (optional)
|
|
|
+ * @param sortOrder optional sort direction (asc, desc) - defaults to asc (optional, default to true)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call getProcessInstancesAsync(String containerId, Long processInstanceId, List<Integer> status, Integer page, Integer pageSize, String sort, Boolean sortOrder, final ApiCallback<ProcessInstanceList> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstancesValidateBeforeCall(containerId, processInstanceId, status, page, pageSize, sort, sortOrder, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<ProcessInstanceList>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for getProcessInstancesByDeploymentId
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param status optional process instance status (active, completed, aborted) - defaults ot active (1) only (optional)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @param sort optional sort column, no default (optional)
|
|
|
+ * @param sortOrder optional sort direction (asc, desc) - defaults to asc (optional, default to true)
|
|
|
+ * @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 getProcessInstancesByDeploymentIdCall(String containerId, List<Integer> status, Integer page, Integer pageSize, String sort, Boolean sortOrder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+ if (status != null)
|
|
|
+ localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "status", status));
|
|
|
+ if (page != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
|
|
|
+ if (pageSize != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize));
|
|
|
+ if (sort != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort));
|
|
|
+ if (sortOrder != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("sortOrder", sortOrder));
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call getProcessInstancesByDeploymentIdValidateBeforeCall(String containerId, List<Integer> status, Integer page, Integer pageSize, String sort, Boolean sortOrder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling getProcessInstancesByDeploymentId(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstancesByDeploymentIdCall(containerId, status, page, pageSize, sort, sortOrder, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns a list of process instances in a specified KIE container.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param status optional process instance status (active, completed, aborted) - defaults ot active (1) only (optional)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @param sort optional sort column, no default (optional)
|
|
|
+ * @param sortOrder optional sort direction (asc, desc) - defaults to asc (optional, default to true)
|
|
|
+ * @return ProcessInstanceList
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ProcessInstanceList getProcessInstancesByDeploymentId(String containerId, List<Integer> status, Integer page, Integer pageSize, String sort, Boolean sortOrder) throws ApiException {
|
|
|
+ ApiResponse<ProcessInstanceList> resp = getProcessInstancesByDeploymentIdWithHttpInfo(containerId, status, page, pageSize, sort, sortOrder);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns a list of process instances in a specified KIE container.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param status optional process instance status (active, completed, aborted) - defaults ot active (1) only (optional)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @param sort optional sort column, no default (optional)
|
|
|
+ * @param sortOrder optional sort direction (asc, desc) - defaults to asc (optional, default to true)
|
|
|
+ * @return ApiResponse<ProcessInstanceList>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<ProcessInstanceList> getProcessInstancesByDeploymentIdWithHttpInfo(String containerId, List<Integer> status, Integer page, Integer pageSize, String sort, Boolean sortOrder) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstancesByDeploymentIdValidateBeforeCall(containerId, status, page, pageSize, sort, sortOrder, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<ProcessInstanceList>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns a list of process instances in a specified KIE container. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param status optional process instance status (active, completed, aborted) - defaults ot active (1) only (optional)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @param sort optional sort column, no default (optional)
|
|
|
+ * @param sortOrder optional sort direction (asc, desc) - defaults to asc (optional, default to true)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call getProcessInstancesByDeploymentIdAsync(String containerId, List<Integer> status, Integer page, Integer pageSize, String sort, Boolean sortOrder, final ApiCallback<ProcessInstanceList> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getProcessInstancesByDeploymentIdValidateBeforeCall(containerId, status, page, pageSize, sort, sortOrder, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<ProcessInstanceList>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for getProcessesByDeploymentId
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @param sort optional sort column, no default (optional)
|
|
|
+ * @param sortOrder optional sort direction (asc, desc) - defaults to asc (optional, default to true)
|
|
|
+ * @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 getProcessesByDeploymentIdCall(String containerId, Integer page, Integer pageSize, String sort, Boolean sortOrder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+ if (page != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
|
|
|
+ if (pageSize != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize));
|
|
|
+ if (sort != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("sort", sort));
|
|
|
+ if (sortOrder != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("sortOrder", sortOrder));
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call getProcessesByDeploymentIdValidateBeforeCall(String containerId, Integer page, Integer pageSize, String sort, Boolean sortOrder, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling getProcessesByDeploymentId(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getProcessesByDeploymentIdCall(containerId, page, pageSize, sort, sortOrder, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns a list of process definitions in a specified KIE container.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @param sort optional sort column, no default (optional)
|
|
|
+ * @param sortOrder optional sort direction (asc, desc) - defaults to asc (optional, default to true)
|
|
|
+ * @return ProcessDefinitions
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ProcessDefinitions getProcessesByDeploymentId(String containerId, Integer page, Integer pageSize, String sort, Boolean sortOrder) throws ApiException {
|
|
|
+ ApiResponse<ProcessDefinitions> resp = getProcessesByDeploymentIdWithHttpInfo(containerId, page, pageSize, sort, sortOrder);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns a list of process definitions in a specified KIE container.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @param sort optional sort column, no default (optional)
|
|
|
+ * @param sortOrder optional sort direction (asc, desc) - defaults to asc (optional, default to true)
|
|
|
+ * @return ApiResponse<ProcessDefinitions>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<ProcessDefinitions> getProcessesByDeploymentIdWithHttpInfo(String containerId, Integer page, Integer pageSize, String sort, Boolean sortOrder) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = getProcessesByDeploymentIdValidateBeforeCall(containerId, page, pageSize, sort, sortOrder, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<ProcessDefinitions>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns a list of process definitions in a specified KIE container. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @param sort optional sort column, no default (optional)
|
|
|
+ * @param sortOrder optional sort direction (asc, desc) - defaults to asc (optional, default to true)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call getProcessesByDeploymentIdAsync(String containerId, Integer page, Integer pageSize, String sort, Boolean sortOrder, final ApiCallback<ProcessDefinitions> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getProcessesByDeploymentIdValidateBeforeCall(containerId, page, pageSize, sort, sortOrder, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<ProcessDefinitions>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for getVariableHistory
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variable history should be collected for (required)
|
|
|
+ * @param varName name of the variables that history should be collected for (required)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @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 getVariableHistoryCall(String containerId, Long processInstanceId, String varName, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}/variables/instances/{varName}"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()))
|
|
|
+ .replaceAll("\\{" + "varName" + "\\}", apiClient.escapeString(varName.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+ if (page != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("page", page));
|
|
|
+ if (pageSize != null)
|
|
|
+ localVarQueryParams.addAll(apiClient.parameterToPair("pageSize", pageSize));
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call getVariableHistoryValidateBeforeCall(String containerId, Long processInstanceId, String varName, Integer page, Integer pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling getVariableHistory(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling getVariableHistory(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'varName' is set
|
|
|
+ if (varName == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'varName' when calling getVariableHistory(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getVariableHistoryCall(containerId, processInstanceId, varName, page, pageSize, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the history of a specified variable in a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variable history should be collected for (required)
|
|
|
+ * @param varName name of the variables that history should be collected for (required)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @return VariableInstanceList
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public VariableInstanceList getVariableHistory(String containerId, Long processInstanceId, String varName, Integer page, Integer pageSize) throws ApiException {
|
|
|
+ ApiResponse<VariableInstanceList> resp = getVariableHistoryWithHttpInfo(containerId, processInstanceId, varName, page, pageSize);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the history of a specified variable in a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variable history should be collected for (required)
|
|
|
+ * @param varName name of the variables that history should be collected for (required)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @return ApiResponse<VariableInstanceList>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<VariableInstanceList> getVariableHistoryWithHttpInfo(String containerId, Long processInstanceId, String varName, Integer page, Integer pageSize) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = getVariableHistoryValidateBeforeCall(containerId, processInstanceId, varName, page, pageSize, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<VariableInstanceList>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the history of a specified variable in a specified process instance. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variable history should be collected for (required)
|
|
|
+ * @param varName name of the variables that history should be collected for (required)
|
|
|
+ * @param page optional pagination - at which page to start, defaults to 0 (meaning first) (optional, default to 0)
|
|
|
+ * @param pageSize optional pagination - size of the result, defaults to 10 (optional, default to 10)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call getVariableHistoryAsync(String containerId, Long processInstanceId, String varName, Integer page, Integer pageSize, final ApiCallback<VariableInstanceList> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getVariableHistoryValidateBeforeCall(containerId, processInstanceId, varName, page, pageSize, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<VariableInstanceList>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for getVariablesCurrentState
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variables state should be collected for (required)
|
|
|
+ * @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 getVariablesCurrentStateCall(String containerId, Long processInstanceId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}/variables/instances"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call getVariablesCurrentStateValidateBeforeCall(String containerId, Long processInstanceId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling getVariablesCurrentState(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling getVariablesCurrentState(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getVariablesCurrentStateCall(containerId, processInstanceId, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the current variable values of a specified process instance in a specified KIE container.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variables state should be collected for (required)
|
|
|
+ * @return VariableInstanceList
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public VariableInstanceList getVariablesCurrentState(String containerId, Long processInstanceId) throws ApiException {
|
|
|
+ ApiResponse<VariableInstanceList> resp = getVariablesCurrentStateWithHttpInfo(containerId, processInstanceId);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the current variable values of a specified process instance in a specified KIE container.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variables state should be collected for (required)
|
|
|
+ * @return ApiResponse<VariableInstanceList>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<VariableInstanceList> getVariablesCurrentStateWithHttpInfo(String containerId, Long processInstanceId) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = getVariablesCurrentStateValidateBeforeCall(containerId, processInstanceId, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<VariableInstanceList>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the current variable values of a specified process instance in a specified KIE container. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that variables state should be collected for (required)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call getVariablesCurrentStateAsync(String containerId, Long processInstanceId, final ApiCallback<VariableInstanceList> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getVariablesCurrentStateValidateBeforeCall(containerId, processInstanceId, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<VariableInstanceList>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for getWorkItem
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work item belongs to (required)
|
|
|
+ * @param workItemId identifier of the work item to retrieve (required)
|
|
|
+ * @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 getWorkItemCall(String containerId, Long processInstanceId, Long workItemId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}/workitems/{workItemId}"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()))
|
|
|
+ .replaceAll("\\{" + "workItemId" + "\\}", apiClient.escapeString(workItemId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call getWorkItemValidateBeforeCall(String containerId, Long processInstanceId, Long workItemId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling getWorkItem(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling getWorkItem(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'workItemId' is set
|
|
|
+ if (workItemId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'workItemId' when calling getWorkItem(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getWorkItemCall(containerId, processInstanceId, workItemId, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns information about a specified work item for a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work item belongs to (required)
|
|
|
+ * @param workItemId identifier of the work item to retrieve (required)
|
|
|
+ * @return WorkItemInstance
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public WorkItemInstance getWorkItem(String containerId, Long processInstanceId, Long workItemId) throws ApiException {
|
|
|
+ ApiResponse<WorkItemInstance> resp = getWorkItemWithHttpInfo(containerId, processInstanceId, workItemId);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns information about a specified work item for a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work item belongs to (required)
|
|
|
+ * @param workItemId identifier of the work item to retrieve (required)
|
|
|
+ * @return ApiResponse<WorkItemInstance>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<WorkItemInstance> getWorkItemWithHttpInfo(String containerId, Long processInstanceId, Long workItemId) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = getWorkItemValidateBeforeCall(containerId, processInstanceId, workItemId, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<WorkItemInstance>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns information about a specified work item for a specified process instance. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work item belongs to (required)
|
|
|
+ * @param workItemId identifier of the work item to retrieve (required)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call getWorkItemAsync(String containerId, Long processInstanceId, Long workItemId, final ApiCallback<WorkItemInstance> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getWorkItemValidateBeforeCall(containerId, processInstanceId, workItemId, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<WorkItemInstance>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for getWorkItemByProcessInstance
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work items belong to (required)
|
|
|
+ * @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 getWorkItemByProcessInstanceCall(String containerId, Long processInstanceId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = null;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}/workitems"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call getWorkItemByProcessInstanceValidateBeforeCall(String containerId, Long processInstanceId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling getWorkItemByProcessInstance(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling getWorkItemByProcessInstance(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getWorkItemByProcessInstanceCall(containerId, processInstanceId, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns all work items for a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work items belong to (required)
|
|
|
+ * @return WorkItemInstanceList
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public WorkItemInstanceList getWorkItemByProcessInstance(String containerId, Long processInstanceId) throws ApiException {
|
|
|
+ ApiResponse<WorkItemInstanceList> resp = getWorkItemByProcessInstanceWithHttpInfo(containerId, processInstanceId);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns all work items for a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work items belong to (required)
|
|
|
+ * @return ApiResponse<WorkItemInstanceList>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<WorkItemInstanceList> getWorkItemByProcessInstanceWithHttpInfo(String containerId, Long processInstanceId) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = getWorkItemByProcessInstanceValidateBeforeCall(containerId, processInstanceId, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<WorkItemInstanceList>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns all work items for a specified process instance. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance that work items belong to (required)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call getWorkItemByProcessInstanceAsync(String containerId, Long processInstanceId, final ApiCallback<WorkItemInstanceList> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = getWorkItemByProcessInstanceValidateBeforeCall(containerId, processInstanceId, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<WorkItemInstanceList>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for setProcessVariable
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be updated (required)
|
|
|
+ * @param varName name of the variable to be set/updated (required)
|
|
|
+ * @param body variable data - any type can be provided (required)
|
|
|
+ * @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 setProcessVariableCall(String containerId, Long processInstanceId, String varName, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = body;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}/variable/{varName}"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()))
|
|
|
+ .replaceAll("\\{" + "varName" + "\\}", apiClient.escapeString(varName.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call setProcessVariableValidateBeforeCall(String containerId, Long processInstanceId, String varName, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling setProcessVariable(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling setProcessVariable(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'varName' is set
|
|
|
+ if (varName == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'varName' when calling setProcessVariable(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'body' is set
|
|
|
+ if (body == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'body' when calling setProcessVariable(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = setProcessVariableCall(containerId, processInstanceId, varName, body, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Creates or updates a variable for a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be updated (required)
|
|
|
+ * @param varName name of the variable to be set/updated (required)
|
|
|
+ * @param body variable data - any type can be provided (required)
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public void setProcessVariable(String containerId, Long processInstanceId, String varName, String body) throws ApiException {
|
|
|
+ setProcessVariableWithHttpInfo(containerId, processInstanceId, varName, body);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Creates or updates a variable for a specified process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be updated (required)
|
|
|
+ * @param varName name of the variable to be set/updated (required)
|
|
|
+ * @param body variable data - any type can be provided (required)
|
|
|
+ * @return ApiResponse<Void>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Void> setProcessVariableWithHttpInfo(String containerId, Long processInstanceId, String varName, String body) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = setProcessVariableValidateBeforeCall(containerId, processInstanceId, varName, body, null, null);
|
|
|
+ return apiClient.execute(call);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Creates or updates a variable for a specified process instance. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be updated (required)
|
|
|
+ * @param varName name of the variable to be set/updated (required)
|
|
|
+ * @param body variable data - any type can be provided (required)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call setProcessVariableAsync(String containerId, Long processInstanceId, String varName, String body, final ApiCallback<Void> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = setProcessVariableValidateBeforeCall(containerId, processInstanceId, varName, body, progressListener, progressRequestListener);
|
|
|
+ apiClient.executeAsync(call, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for setProcessVariables
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be updated (required)
|
|
|
+ * @param body variable data give as map (required)
|
|
|
+ * @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 setProcessVariablesCall(String containerId, Long processInstanceId, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = body;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}/variables"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call setProcessVariablesValidateBeforeCall(String containerId, Long processInstanceId, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling setProcessVariables(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling setProcessVariables(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'body' is set
|
|
|
+ if (body == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'body' when calling setProcessVariables(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = setProcessVariablesCall(containerId, processInstanceId, body, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Updates the values of one or more variable for a specified process instance. The request is a map in which the key is the variable name and the value is the new variable value.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be updated (required)
|
|
|
+ * @param body variable data give as map (required)
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public void setProcessVariables(String containerId, Long processInstanceId, String body) throws ApiException {
|
|
|
+ setProcessVariablesWithHttpInfo(containerId, processInstanceId, body);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Updates the values of one or more variable for a specified process instance. The request is a map in which the key is the variable name and the value is the new variable value.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be updated (required)
|
|
|
+ * @param body variable data give as map (required)
|
|
|
+ * @return ApiResponse<Void>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Void> setProcessVariablesWithHttpInfo(String containerId, Long processInstanceId, String body) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = setProcessVariablesValidateBeforeCall(containerId, processInstanceId, body, null, null);
|
|
|
+ return apiClient.execute(call);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Updates the values of one or more variable for a specified process instance. The request is a map in which the key is the variable name and the value is the new variable value. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be updated (required)
|
|
|
+ * @param body variable data give as map (required)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call setProcessVariablesAsync(String containerId, Long processInstanceId, String body, final ApiCallback<Void> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = setProcessVariablesValidateBeforeCall(containerId, processInstanceId, body, progressListener, progressRequestListener);
|
|
|
+ apiClient.executeAsync(call, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for signalProcessInstance
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be signaled (required)
|
|
|
+ * @param signalName signal name to be send to process instance (required)
|
|
|
+ * @param body optional event data - any type can be provided (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 signalProcessInstanceCall(String containerId, Long processInstanceId, String signalName, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = body;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/{processInstanceId}/signal/{signalName}"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processInstanceId" + "\\}", apiClient.escapeString(processInstanceId.toString()))
|
|
|
+ .replaceAll("\\{" + "signalName" + "\\}", apiClient.escapeString(signalName.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call signalProcessInstanceValidateBeforeCall(String containerId, Long processInstanceId, String signalName, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling signalProcessInstance(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processInstanceId' is set
|
|
|
+ if (processInstanceId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processInstanceId' when calling signalProcessInstance(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'signalName' is set
|
|
|
+ if (signalName == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'signalName' when calling signalProcessInstance(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = signalProcessInstanceCall(containerId, processInstanceId, signalName, body, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Signals a specified process instance with a specified signal name and optional signal data.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be signaled (required)
|
|
|
+ * @param signalName signal name to be send to process instance (required)
|
|
|
+ * @param body optional event data - any type can be provided (optional)
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public void signalProcessInstance(String containerId, Long processInstanceId, String signalName, String body) throws ApiException {
|
|
|
+ signalProcessInstanceWithHttpInfo(containerId, processInstanceId, signalName, body);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Signals a specified process instance with a specified signal name and optional signal data.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be signaled (required)
|
|
|
+ * @param signalName signal name to be send to process instance (required)
|
|
|
+ * @param body optional event data - any type can be provided (optional)
|
|
|
+ * @return ApiResponse<Void>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Void> signalProcessInstanceWithHttpInfo(String containerId, Long processInstanceId, String signalName, String body) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = signalProcessInstanceValidateBeforeCall(containerId, processInstanceId, signalName, body, null, null);
|
|
|
+ return apiClient.execute(call);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Signals a specified process instance with a specified signal name and optional signal data. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param processInstanceId identifier of the process instance to be signaled (required)
|
|
|
+ * @param signalName signal name to be send to process instance (required)
|
|
|
+ * @param body optional event data - any type can be provided (optional)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call signalProcessInstanceAsync(String containerId, Long processInstanceId, String signalName, String body, final ApiCallback<Void> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = signalProcessInstanceValidateBeforeCall(containerId, processInstanceId, signalName, body, progressListener, progressRequestListener);
|
|
|
+ apiClient.executeAsync(call, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for signalProcessInstanceByCorrelationKey
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param correlationKey correlation key of the process instance to be signaled (required)
|
|
|
+ * @param signalName signal name to be sent to process instance (required)
|
|
|
+ * @param body optional event data - any type can be provided (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 signalProcessInstanceByCorrelationKeyCall(String containerId, String correlationKey, String signalName, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = body;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/correlation/{correlationKey}/signal/{signalName}"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "correlationKey" + "\\}", apiClient.escapeString(correlationKey.toString()))
|
|
|
+ .replaceAll("\\{" + "signalName" + "\\}", apiClient.escapeString(signalName.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call signalProcessInstanceByCorrelationKeyValidateBeforeCall(String containerId, String correlationKey, String signalName, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling signalProcessInstanceByCorrelationKey(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'correlationKey' is set
|
|
|
+ if (correlationKey == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'correlationKey' when calling signalProcessInstanceByCorrelationKey(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'signalName' is set
|
|
|
+ if (signalName == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'signalName' when calling signalProcessInstanceByCorrelationKey(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = signalProcessInstanceByCorrelationKeyCall(containerId, correlationKey, signalName, body, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Signals a specified process instance by correlation key with a specified signal name and optional signal data.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param correlationKey correlation key of the process instance to be signaled (required)
|
|
|
+ * @param signalName signal name to be sent to process instance (required)
|
|
|
+ * @param body optional event data - any type can be provided (optional)
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public void signalProcessInstanceByCorrelationKey(String containerId, String correlationKey, String signalName, String body) throws ApiException {
|
|
|
+ signalProcessInstanceByCorrelationKeyWithHttpInfo(containerId, correlationKey, signalName, body);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Signals a specified process instance by correlation key with a specified signal name and optional signal data.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param correlationKey correlation key of the process instance to be signaled (required)
|
|
|
+ * @param signalName signal name to be sent to process instance (required)
|
|
|
+ * @param body optional event data - any type can be provided (optional)
|
|
|
+ * @return ApiResponse<Void>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Void> signalProcessInstanceByCorrelationKeyWithHttpInfo(String containerId, String correlationKey, String signalName, String body) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = signalProcessInstanceByCorrelationKeyValidateBeforeCall(containerId, correlationKey, signalName, body, null, null);
|
|
|
+ return apiClient.execute(call);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Signals a specified process instance by correlation key with a specified signal name and optional signal data. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param correlationKey correlation key of the process instance to be signaled (required)
|
|
|
+ * @param signalName signal name to be sent to process instance (required)
|
|
|
+ * @param body optional event data - any type can be provided (optional)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call signalProcessInstanceByCorrelationKeyAsync(String containerId, String correlationKey, String signalName, String body, final ApiCallback<Void> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = signalProcessInstanceByCorrelationKeyValidateBeforeCall(containerId, correlationKey, signalName, body, progressListener, progressRequestListener);
|
|
|
+ apiClient.executeAsync(call, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for signalProcessInstances
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param signalName signal name to be send to process instance (required)
|
|
|
+ * @param instanceId list of identifiers of the process instances to be signaled (optional)
|
|
|
+ * @param correlationKey list of correlationKeys of the process instances to be signaled (optional)
|
|
|
+ * @param body optional event data - any type can be provided (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 signalProcessInstancesCall(String containerId, String signalName, List<Long> instanceId, List<String> correlationKey, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = body;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/instances/signal/{signalName}"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "signalName" + "\\}", apiClient.escapeString(signalName.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+ if (instanceId != null)
|
|
|
+ localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "instanceId", instanceId));
|
|
|
+ if (correlationKey != null)
|
|
|
+ localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "correlationKey", correlationKey));
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call signalProcessInstancesValidateBeforeCall(String containerId, String signalName, List<Long> instanceId, List<String> correlationKey, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling signalProcessInstances(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'signalName' is set
|
|
|
+ if (signalName == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'signalName' when calling signalProcessInstances(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = signalProcessInstancesCall(containerId, signalName, instanceId, correlationKey, body, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Signals multiple process instances with a specified signal name.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param signalName signal name to be send to process instance (required)
|
|
|
+ * @param instanceId list of identifiers of the process instances to be signaled (optional)
|
|
|
+ * @param correlationKey list of correlationKeys of the process instances to be signaled (optional)
|
|
|
+ * @param body optional event data - any type can be provided (optional)
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public void signalProcessInstances(String containerId, String signalName, List<Long> instanceId, List<String> correlationKey, String body) throws ApiException {
|
|
|
+ signalProcessInstancesWithHttpInfo(containerId, signalName, instanceId, correlationKey, body);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Signals multiple process instances with a specified signal name.
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param signalName signal name to be send to process instance (required)
|
|
|
+ * @param instanceId list of identifiers of the process instances to be signaled (optional)
|
|
|
+ * @param correlationKey list of correlationKeys of the process instances to be signaled (optional)
|
|
|
+ * @param body optional event data - any type can be provided (optional)
|
|
|
+ * @return ApiResponse<Void>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Void> signalProcessInstancesWithHttpInfo(String containerId, String signalName, List<Long> instanceId, List<String> correlationKey, String body) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = signalProcessInstancesValidateBeforeCall(containerId, signalName, instanceId, correlationKey, body, null, null);
|
|
|
+ return apiClient.execute(call);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Signals multiple process instances with a specified signal name. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id that process instance belongs to (required)
|
|
|
+ * @param signalName signal name to be send to process instance (required)
|
|
|
+ * @param instanceId list of identifiers of the process instances to be signaled (optional)
|
|
|
+ * @param correlationKey list of correlationKeys of the process instances to be signaled (optional)
|
|
|
+ * @param body optional event data - any type can be provided (optional)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call signalProcessInstancesAsync(String containerId, String signalName, List<Long> instanceId, List<String> correlationKey, String body, final ApiCallback<Void> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = signalProcessInstancesValidateBeforeCall(containerId, signalName, instanceId, correlationKey, body, progressListener, progressRequestListener);
|
|
|
+ apiClient.executeAsync(call, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for startProcess
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process id that new instance should be created from (required)
|
|
|
+ * @param body optional map of process variables (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 startProcessCall(String containerId, String processId, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = body;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/{processId}/instances"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processId" + "\\}", apiClient.escapeString(processId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call startProcessValidateBeforeCall(String containerId, String processId, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling startProcess(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processId' is set
|
|
|
+ if (processId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processId' when calling startProcess(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = startProcessCall(containerId, processId, body, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new process instance of a specified process.
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process id that new instance should be created from (required)
|
|
|
+ * @param body optional map of process variables (optional)
|
|
|
+ * @return Long
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public Long startProcess(String containerId, String processId, String body) throws ApiException {
|
|
|
+ ApiResponse<Long> resp = startProcessWithHttpInfo(containerId, processId, body);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new process instance of a specified process.
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process id that new instance should be created from (required)
|
|
|
+ * @param body optional map of process variables (optional)
|
|
|
+ * @return ApiResponse<Long>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Long> startProcessWithHttpInfo(String containerId, String processId, String body) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = startProcessValidateBeforeCall(containerId, processId, body, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<Long>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new process instance of a specified process. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process id that new instance should be created from (required)
|
|
|
+ * @param body optional map of process variables (optional)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call startProcessAsync(String containerId, String processId, String body, final ApiCallback<Long> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = startProcessValidateBeforeCall(containerId, processId, body, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<Long>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for startProcessFromNodeIds
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process instance id that new instance should be created from (required)
|
|
|
+ * @param body optional map of process variables (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 startProcessFromNodeIdsCall(String containerId, String processId, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = body;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/{processId}/instances/fromNodes"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processId" + "\\}", apiClient.escapeString(processId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call startProcessFromNodeIdsValidateBeforeCall(String containerId, String processId, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling startProcessFromNodeIds(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processId' is set
|
|
|
+ if (processId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processId' when calling startProcessFromNodeIds(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = startProcessFromNodeIdsCall(containerId, processId, body, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new process instance from the specific nodes
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process instance id that new instance should be created from (required)
|
|
|
+ * @param body optional map of process variables (optional)
|
|
|
+ * @return Long
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public Long startProcessFromNodeIds(String containerId, String processId, String body) throws ApiException {
|
|
|
+ ApiResponse<Long> resp = startProcessFromNodeIdsWithHttpInfo(containerId, processId, body);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new process instance from the specific nodes
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process instance id that new instance should be created from (required)
|
|
|
+ * @param body optional map of process variables (optional)
|
|
|
+ * @return ApiResponse<Long>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Long> startProcessFromNodeIdsWithHttpInfo(String containerId, String processId, String body) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = startProcessFromNodeIdsValidateBeforeCall(containerId, processId, body, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<Long>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new process instance from the specific nodes (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process instance id that new instance should be created from (required)
|
|
|
+ * @param body optional map of process variables (optional)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call startProcessFromNodeIdsAsync(String containerId, String processId, String body, final ApiCallback<Long> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = startProcessFromNodeIdsValidateBeforeCall(containerId, processId, body, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<Long>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for startProcessWithCorrelation
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process id that new instance should be created from (required)
|
|
|
+ * @param correlationKey correlation key to be assigned to process instance (required)
|
|
|
+ * @param body optional map of process variables (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 startProcessWithCorrelationCall(String containerId, String processId, String correlationKey, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = body;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/{processId}/instances/correlation/{correlationKey}"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processId" + "\\}", apiClient.escapeString(processId.toString()))
|
|
|
+ .replaceAll("\\{" + "correlationKey" + "\\}", apiClient.escapeString(correlationKey.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call startProcessWithCorrelationValidateBeforeCall(String containerId, String processId, String correlationKey, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling startProcessWithCorrelation(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processId' is set
|
|
|
+ if (processId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processId' when calling startProcessWithCorrelation(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'correlationKey' is set
|
|
|
+ if (correlationKey == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'correlationKey' when calling startProcessWithCorrelation(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = startProcessWithCorrelationCall(containerId, processId, correlationKey, body, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new process instance of a specified process and assigns a new correlation key to the process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process id that new instance should be created from (required)
|
|
|
+ * @param correlationKey correlation key to be assigned to process instance (required)
|
|
|
+ * @param body optional map of process variables (optional)
|
|
|
+ * @return Long
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public Long startProcessWithCorrelation(String containerId, String processId, String correlationKey, String body) throws ApiException {
|
|
|
+ ApiResponse<Long> resp = startProcessWithCorrelationWithHttpInfo(containerId, processId, correlationKey, body);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new process instance of a specified process and assigns a new correlation key to the process instance.
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process id that new instance should be created from (required)
|
|
|
+ * @param correlationKey correlation key to be assigned to process instance (required)
|
|
|
+ * @param body optional map of process variables (optional)
|
|
|
+ * @return ApiResponse<Long>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Long> startProcessWithCorrelationWithHttpInfo(String containerId, String processId, String correlationKey, String body) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = startProcessWithCorrelationValidateBeforeCall(containerId, processId, correlationKey, body, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<Long>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new process instance of a specified process and assigns a new correlation key to the process instance. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process id that new instance should be created from (required)
|
|
|
+ * @param correlationKey correlation key to be assigned to process instance (required)
|
|
|
+ * @param body optional map of process variables (optional)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call startProcessWithCorrelationAsync(String containerId, String processId, String correlationKey, String body, final ApiCallback<Long> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = startProcessWithCorrelationValidateBeforeCall(containerId, processId, correlationKey, body, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<Long>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for startProcessWithCorrelationKeyFromNodeIds
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process instance id that new instance should be created from (required)
|
|
|
+ * @param correlationKey correlation key that should be used for creating the process (required)
|
|
|
+ * @param body start process specifications (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 startProcessWithCorrelationKeyFromNodeIdsCall(String containerId, String processId, String correlationKey, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = body;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/{processId}/instances/correlation/{correlationKey}/fromNodes"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processId" + "\\}", apiClient.escapeString(processId.toString()))
|
|
|
+ .replaceAll("\\{" + "correlationKey" + "\\}", apiClient.escapeString(correlationKey.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call startProcessWithCorrelationKeyFromNodeIdsValidateBeforeCall(String containerId, String processId, String correlationKey, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling startProcessWithCorrelationKeyFromNodeIds(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processId' is set
|
|
|
+ if (processId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processId' when calling startProcessWithCorrelationKeyFromNodeIds(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'correlationKey' is set
|
|
|
+ if (correlationKey == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'correlationKey' when calling startProcessWithCorrelationKeyFromNodeIds(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = startProcessWithCorrelationKeyFromNodeIdsCall(containerId, processId, correlationKey, body, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new process instance from the specific nodes
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process instance id that new instance should be created from (required)
|
|
|
+ * @param correlationKey correlation key that should be used for creating the process (required)
|
|
|
+ * @param body start process specifications (optional)
|
|
|
+ * @return Long
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public Long startProcessWithCorrelationKeyFromNodeIds(String containerId, String processId, String correlationKey, String body) throws ApiException {
|
|
|
+ ApiResponse<Long> resp = startProcessWithCorrelationKeyFromNodeIdsWithHttpInfo(containerId, processId, correlationKey, body);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new process instance from the specific nodes
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process instance id that new instance should be created from (required)
|
|
|
+ * @param correlationKey correlation key that should be used for creating the process (required)
|
|
|
+ * @param body start process specifications (optional)
|
|
|
+ * @return ApiResponse<Long>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Long> startProcessWithCorrelationKeyFromNodeIdsWithHttpInfo(String containerId, String processId, String correlationKey, String body) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = startProcessWithCorrelationKeyFromNodeIdsValidateBeforeCall(containerId, processId, correlationKey, body, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<Long>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new process instance from the specific nodes (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process instance id that new instance should be created from (required)
|
|
|
+ * @param correlationKey correlation key that should be used for creating the process (required)
|
|
|
+ * @param body start process specifications (optional)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call startProcessWithCorrelationKeyFromNodeIdsAsync(String containerId, String processId, String correlationKey, String body, final ApiCallback<Long> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = startProcessWithCorrelationKeyFromNodeIdsValidateBeforeCall(containerId, processId, correlationKey, body, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<Long>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Build call for startSynchronousProcess
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process id that new instance should be created from (required)
|
|
|
+ * @param body optional map of process variables (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 startSynchronousProcessCall(String containerId, String processId, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+ Object localVarPostBody = body;
|
|
|
+
|
|
|
+ // create path and map variables
|
|
|
+ String localVarPath = "/server/containers/{containerId}/processes/{processId}/computedInstances"
|
|
|
+ .replaceAll("\\{" + "containerId" + "\\}", apiClient.escapeString(containerId.toString()))
|
|
|
+ .replaceAll("\\{" + "processId" + "\\}", apiClient.escapeString(processId.toString()));
|
|
|
+
|
|
|
+ List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
|
+ List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
|
|
+
|
|
|
+ Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
|
+
|
|
|
+ Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ final String[] localVarAccepts = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
|
|
+ if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
|
|
|
+
|
|
|
+ final String[] localVarContentTypes = {
|
|
|
+ "application/json", "application/xml"
|
|
|
+ };
|
|
|
+ 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[] { "basicAuth" };
|
|
|
+ return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("rawtypes")
|
|
|
+ private com.squareup.okhttp.Call startSynchronousProcessValidateBeforeCall(String containerId, String processId, String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
|
|
|
+
|
|
|
+ // verify the required parameter 'containerId' is set
|
|
|
+ if (containerId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'containerId' when calling startSynchronousProcess(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+ // verify the required parameter 'processId' is set
|
|
|
+ if (processId == null) {
|
|
|
+ throw new ApiException("Missing the required parameter 'processId' when calling startSynchronousProcess(Async)");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = startSynchronousProcessCall(containerId, processId, body, progressListener, progressRequestListener);
|
|
|
+ return call;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new synchronous process instance of a specified process.
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process id that new instance should be created from (required)
|
|
|
+ * @param body optional map of process variables (optional)
|
|
|
+ * @return Map<String, Object>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public Map<String, Object> startSynchronousProcess(String containerId, String processId, String body) throws ApiException {
|
|
|
+ ApiResponse<Map<String, Object>> resp = startSynchronousProcessWithHttpInfo(containerId, processId, body);
|
|
|
+ return resp.getData();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new synchronous process instance of a specified process.
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process id that new instance should be created from (required)
|
|
|
+ * @param body optional map of process variables (optional)
|
|
|
+ * @return ApiResponse<Map<String, Object>>
|
|
|
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
|
|
+ */
|
|
|
+ public ApiResponse<Map<String, Object>> startSynchronousProcessWithHttpInfo(String containerId, String processId, String body) throws ApiException {
|
|
|
+ com.squareup.okhttp.Call call = startSynchronousProcessValidateBeforeCall(containerId, processId, body, null, null);
|
|
|
+ Type localVarReturnType = new TypeToken<Map<String, Object>>(){}.getType();
|
|
|
+ return apiClient.execute(call, localVarReturnType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Starts a new synchronous process instance of a specified process. (asynchronously)
|
|
|
+ *
|
|
|
+ * @param containerId container id where the process definition resides (required)
|
|
|
+ * @param processId process id that new instance should be created from (required)
|
|
|
+ * @param body optional map of process variables (optional)
|
|
|
+ * @param callback The callback to be executed when the API call finishes
|
|
|
+ * @return The request call
|
|
|
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
|
|
+ */
|
|
|
+ public com.squareup.okhttp.Call startSynchronousProcessAsync(String containerId, String processId, String body, final ApiCallback<Map<String, Object>> callback) throws ApiException {
|
|
|
+
|
|
|
+ ProgressResponseBody.ProgressListener progressListener = null;
|
|
|
+ ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
|
|
|
+
|
|
|
+ if (callback != null) {
|
|
|
+ progressListener = new ProgressResponseBody.ProgressListener() {
|
|
|
+ @Override
|
|
|
+ public void update(long bytesRead, long contentLength, boolean done) {
|
|
|
+ callback.onDownloadProgress(bytesRead, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
|
|
|
+ @Override
|
|
|
+ public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
|
|
|
+ callback.onUploadProgress(bytesWritten, contentLength, done);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ com.squareup.okhttp.Call call = startSynchronousProcessValidateBeforeCall(containerId, processId, body, progressListener, progressRequestListener);
|
|
|
+ Type localVarReturnType = new TypeToken<Map<String, Object>>(){}.getType();
|
|
|
+ apiClient.executeAsync(call, localVarReturnType, callback);
|
|
|
+ return call;
|
|
|
+ }
|
|
|
+}
|