Class CompleteJobCommandImpl
- All Implemented Interfaces:
CommandWithCommunicationApiStep<CompleteJobCommandStep1>,CommandWithVariables<CompleteJobCommandStep1>,CompleteJobCommandStep1,CompleteJobCommandStep1.CompleteJobCommandJobResultStep,FinalCommandStep<CompleteJobResponse>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.client.api.command.CompleteJobCommandStep1
CompleteJobCommandStep1.CompleteJobCommandJobResultStep -
Field Summary
Fields inherited from class io.camunda.client.impl.command.CommandWithVariables
objectMapper -
Constructor Summary
ConstructorsConstructorDescriptionCompleteJobCommandImpl(GatewayGrpc.GatewayStub asyncStub, JsonMapper jsonMapper, long key, Duration requestTimeout, Predicate<CredentialsProvider.StatusCode> retryPredicate, HttpClient httpClient, boolean preferRestOverGrpc) -
Method Summary
Modifier and TypeMethodDescriptionInitialized the job result to allow activation of elements in an ad-hoc sub process.Initializes the job result to allow corrections or a denial to be configured.requestTimeout(Duration requestTimeout) Sets the request timeout for the command.send()Sends the command to the Camunda gateway.protected CompleteJobCommandStep1setVariablesInternal(String variables) useGrpc()Experimental: This method is under development, and as such using it may have no effect on the command builder when called.useRest()Experimental: This method is under development, and as such using it may have no effect on the command builder when called.withResult(Function<CompleteJobCommandStep1.CompleteJobCommandJobResultStep, CompleteJobResult> function) Initializes the job result to allow followup actions to be configured.Methods inherited from class io.camunda.client.impl.command.CommandWithVariables
variable, variables, variables, variables, variablesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.camunda.client.api.command.CompleteJobCommandStep1
variable, variables, variables, variables, variablesMethods inherited from interface io.camunda.client.api.command.FinalCommandStep
execute
-
Constructor Details
-
CompleteJobCommandImpl
public CompleteJobCommandImpl(GatewayGrpc.GatewayStub asyncStub, JsonMapper jsonMapper, long key, Duration requestTimeout, Predicate<CredentialsProvider.StatusCode> retryPredicate, HttpClient httpClient, boolean preferRestOverGrpc)
-
-
Method Details
-
requestTimeout
Description copied from interface:FinalCommandStepSets the request timeout for the command. The default request timeout can be configured usingCamundaClientBuilder.defaultRequestTimeout(Duration).- Specified by:
requestTimeoutin interfaceFinalCommandStep<CompleteJobResponse>- Parameters:
requestTimeout- the request timeout- Returns:
- the configured command
-
send
Description copied from interface:FinalCommandStepSends the command to the Camunda gateway. This operation is asynchronous. In case of success, the future returns the event that was generated by the Camunda gateway in response to the command.Call
CamundaFuture.join()to wait until the response is available.Future<JobEventinvalid input: '>' future = command.send(); JobEvent event = future.join();- Specified by:
sendin interfaceFinalCommandStep<CompleteJobResponse>- Returns:
- a future tracking state of success/failure of the command.
-
withResult
public CompleteJobCommandStep1 withResult(Function<CompleteJobCommandStep1.CompleteJobCommandJobResultStep, CompleteJobResult> function) Description copied from interface:CompleteJobCommandStep1Initializes the job result to allow followup actions to be configured.- Specified by:
withResultin interfaceCompleteJobCommandStep1- Returns:
- the builder for this command.
-
forUserTask
Description copied from interface:CompleteJobCommandStep1.CompleteJobCommandJobResultStepInitializes the job result to allow corrections or a denial to be configured.This method is used to apply changes to user task attributes (such as
assignee,priority,dueDate, and so on) or explicitly deny a user task lifecycle transition.Example usage:
client.newCompleteJobCommand(jobKey) .withResult(r -> r.forUserTask() .correctAssignee("john_doe") // dynamically reassigns the task to 'john_doe' .correctPriority(84) // adjusts the priority of the task .correctDueDate("2024-11-22T11:44:55.0000Z")) // sets a new due date .send();- Specified by:
forUserTaskin interfaceCompleteJobCommandStep1.CompleteJobCommandJobResultStep- Returns:
- the builder for this command.
-
forAdHocSubProcess
Description copied from interface:CompleteJobCommandStep1.CompleteJobCommandJobResultStepInitialized the job result to allow activation of elements in an ad-hoc sub process.This method is used to activate elements as a followup of a job completion. It will activate elements by id and variables provided will be created in the scope of the created element.
client.newCompleteJobCommand(jobKey) .withResult(r -> r.forAdHocSubProcess() .activateElement("elementId") // Activate the element with id 'elementId' .variable("key", "value") // Create variable in the scope of 'elementId' .activateElement("anotherElementId")) // Activate another element with id 'anotherElementId' .variable("key", "value") // Create a variable in the scope of 'anotherElementId' .send();- Specified by:
forAdHocSubProcessin interfaceCompleteJobCommandStep1.CompleteJobCommandJobResultStep- Returns:
- the builder for this command.
-
useRest
Description copied from interface:CommandWithCommunicationApiStepExperimental: This method is under development, and as such using it may have no effect on the command builder when called. While unimplemented, it simply returns the command builder instance unchanged. This method already exists for software that is building support for a REST API in Camunda, and already wants to use this API during its development. As support for REST is added to Camunda, each of the commands that implement this method may start to take effect. Until this warning is removed, anything described below may not yet have taken effect, and the interface and its description are subject to change.Sets REST as the communication API for this command. If this command doesn't support communication over REST, it simply returns the command builder instance unchanged. The default communication API can be configured using
CamundaClientBuilder.preferRestOverGrpc(boolean).- Specified by:
useRestin interfaceCommandWithCommunicationApiStep<CompleteJobCommandStep1>- Returns:
- the configured command
-
useGrpc
Description copied from interface:CommandWithCommunicationApiStepExperimental: This method is under development, and as such using it may have no effect on the command builder when called. While unimplemented, it simply returns the command builder instance unchanged. This method already exists for software that is building support for a REST API in Camunda, and already wants to use this API during its development. As support for REST is added to Zeebe, each of the commands that implement this method may start to take effect. Until this warning is removed, anything described below may not yet have taken effect, and the interface and its description are subject to change.Sets gRPC as the communication API for this command. If this command doesn't support communication over gRPC, it simply returns the command builder instance unchanged. The default communication API can be configured using
CamundaClientBuilder.preferRestOverGrpc(boolean).- Specified by:
useGrpcin interfaceCommandWithCommunicationApiStep<CompleteJobCommandStep1>- Returns:
- the configured command
-
setVariablesInternal
- Specified by:
setVariablesInternalin classCommandWithVariables<CompleteJobCommandStep1>
-