Package io.camunda.client.impl.command
Class ModifyProcessInstanceCommandImpl
java.lang.Object
io.camunda.client.impl.command.ModifyProcessInstanceCommandImpl
- All Implemented Interfaces:
CommandWithCommunicationApiStep<ModifyProcessInstanceCommandStep1>,CommandWithOperationReferenceStep<ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep2>,FinalCommandStep<ModifyProcessInstanceResponse>,ModifyProcessInstanceCommandStep1,ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep2,ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3
public final class ModifyProcessInstanceCommandImpl
extends Object
implements ModifyProcessInstanceCommandStep1, ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.client.api.command.ModifyProcessInstanceCommandStep1
ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep2, ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 -
Constructor Summary
ConstructorsConstructorDescriptionModifyProcessInstanceCommandImpl(long processInstanceKey, JsonMapper jsonMapper, GatewayGrpc.GatewayStub asyncStub, Predicate<CredentialsProvider.StatusCode> retryPredicate, HttpClient httpClient, CamundaClientConfiguration config) -
Method Summary
Modifier and TypeMethodDescriptionactivateElement(String elementId) Create anGatewayOuterClass.ModifyProcessInstanceRequest.ActivateInstructionfor the given element id.activateElement(String elementId, long ancestorElementInstanceKey) Create anGatewayOuterClass.ModifyProcessInstanceRequest.ActivateInstructionfor the given element id.and()Acts as a boundary between the different activate and terminate instructions.operationReference(long operationReference) Set the Operation Reference.requestTimeout(Duration requestTimeout) Sets the request timeout for the command.send()Sends the command to the Camunda gateway.terminateElement(long elementInstanceKey) Create aGatewayOuterClass.ModifyProcessInstanceRequest.TerminateInstructionfor the given element id.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.withVariable(String key, Object value) Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated.withVariable(String key, Object value, String scopeId) Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated.withVariables(InputStream variables) Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated.withVariables(InputStream variables, String scopeId) Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated.withVariables(Object variables) Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated.withVariables(Object variables, String scopeId) Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated.withVariables(String variables) Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated.withVariables(String variables, String scopeId) Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated.withVariables(Map<String, Object> variables) Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated.withVariables(Map<String, Object> variables, String scopeId) Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated.Methods 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.FinalCommandStep
execute
-
Constructor Details
-
ModifyProcessInstanceCommandImpl
public ModifyProcessInstanceCommandImpl(long processInstanceKey, JsonMapper jsonMapper, GatewayGrpc.GatewayStub asyncStub, Predicate<CredentialsProvider.StatusCode> retryPredicate, HttpClient httpClient, CamundaClientConfiguration config)
-
-
Method Details
-
activateElement
public ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 activateElement(String elementId) Description copied from interface:ModifyProcessInstanceCommandStep1Create anGatewayOuterClass.ModifyProcessInstanceRequest.ActivateInstructionfor the given element id. The element will be created within an existing element instance of the flow scope. When activating an element inside a multi-instance element the element instance key of the ancestor must be defined. For this useModifyProcessInstanceCommandStep1.activateElement(String, long).- Specified by:
activateElementin interfaceModifyProcessInstanceCommandStep1- Parameters:
elementId- the id of the element to activate- Returns:
- the builder for this command
-
activateElement
public ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 activateElement(String elementId, long ancestorElementInstanceKey) Description copied from interface:ModifyProcessInstanceCommandStep1Create anGatewayOuterClass.ModifyProcessInstanceRequest.ActivateInstructionfor the given element id. The element will be created within the scope that is passed. This scope must be an ancestor of the element that's getting activated.- Specified by:
activateElementin interfaceModifyProcessInstanceCommandStep1- Parameters:
elementId- the id of the element to activateancestorElementInstanceKey- the element instance key in which the element will be created- Returns:
- the builder for this command
-
terminateElement
public ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep2 terminateElement(long elementInstanceKey) Description copied from interface:ModifyProcessInstanceCommandStep1Create aGatewayOuterClass.ModifyProcessInstanceRequest.TerminateInstructionfor the given element id.- Specified by:
terminateElementin interfaceModifyProcessInstanceCommandStep1- Parameters:
elementInstanceKey- the element instance key of the element to termiante- Returns:
- the builder for this command
-
and
Description copied from interface:ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep2Acts as a boundary between the different activate and terminate instructions. Use this if you want to activate or terminate another element. Otherwise,FinalCommandStep.send()the command.- Specified by:
andin interfaceModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep2- Returns:
- the builder for this command
-
withVariables
public ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 withVariables(InputStream variables) Description copied from interface:ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated. These variables will be created in the global scope of the process instance.- Specified by:
withVariablesin interfaceModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3- Parameters:
variables- the variables JSON document as stream- Returns:
- the builder for this command
-
withVariables
public ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 withVariables(InputStream variables, String scopeId) Description copied from interface:ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated. These variables will be created in the scope of the passed element.- Specified by:
withVariablesin interfaceModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3- Parameters:
variables- the variables JSON document as streamscopeId- the id of the element in which scope the variables should be created- Returns:
- the builder for this command
-
withVariables
public ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 withVariables(String variables) Description copied from interface:ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated. These variables will be created in the global scope of the process instance.- Specified by:
withVariablesin interfaceModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3- Parameters:
variables- the variables JSON document as String- Returns:
- the builder for this command
-
withVariables
public ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 withVariables(String variables, String scopeId) Description copied from interface:ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated. These variables will be created in the scope of the passed element.- Specified by:
withVariablesin interfaceModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3- Parameters:
variables- the variables JSON document as StringscopeId- the id of the element in which scope the variables should be created- Returns:
- the builder for this command
-
withVariables
public ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 withVariables(Map<String, Object> variables) Description copied from interface:ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated. These variables will be created in the global scope of the process instance.- Specified by:
withVariablesin interfaceModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3- Parameters:
variables- the variables JSON document as map- Returns:
- the builder for this command
-
withVariables
public ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 withVariables(Map<String, Object> variables, String scopeId) Description copied from interface:ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated. These variables will be created in the scope of the passed element.- Specified by:
withVariablesin interfaceModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3- Parameters:
variables- the variables JSON document as mapscopeId- the id of the element in which scope the variables should be created- Returns:
- the builder for this command
-
withVariables
public ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 withVariables(Object variables) Description copied from interface:ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated. These variables will be created in the global scope of the process instance.- Specified by:
withVariablesin interfaceModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3- Parameters:
variables- the variables document as object to be serialized to JSON- Returns:
- the builder for this command
-
withVariables
public ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 withVariables(Object variables, String scopeId) Description copied from interface:ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated. These variables will be created in the scope of the passed element.- Specified by:
withVariablesin interfaceModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3- Parameters:
variables- the variables document as object to be serialized to JSONscopeId- the id of the element in which scope the variables should be created- Returns:
- the builder for this command
-
withVariable
public ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 withVariable(String key, Object value) Description copied from interface:ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated. This variable will be created in the global scope of the process instance.- Specified by:
withVariablein interfaceModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3- Parameters:
key- the key of the variable to be serialized to JSONvalue- the value of the variable to be serialized to JSON- Returns:
- the builder for this command
-
withVariable
public ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 withVariable(String key, Object value, String scopeId) Description copied from interface:ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3Create aGatewayOuterClass.ModifyProcessInstanceRequest.VariableInstructionfor the element that's getting activated. This variable will be created in the scope of the passed element.- Specified by:
withVariablein interfaceModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3- Parameters:
key- the key of the variable to be serialized to JSONvalue- the value of the variable to be serialized to JSONscopeId- the id of the element in which scope the variable should be created- Returns:
- the builder for this command
-
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<ModifyProcessInstanceResponse>- 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<ModifyProcessInstanceResponse>- Returns:
- a future tracking state of success/failure of the command.
-
operationReference
public ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep2 operationReference(long operationReference) Description copied from interface:CommandWithOperationReferenceStepSet the Operation Reference.This is a key chosen by the user and will be part of all records resulted from this operation
- Specified by:
operationReferencein interfaceCommandWithOperationReferenceStep<ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep2>- Parameters:
operationReference- a reference key chosen by the user and will be part of all records resulted from this operation- Returns:
- the builder for this command with the operation reference specified
-
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<ModifyProcessInstanceCommandStep1>- 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<ModifyProcessInstanceCommandStep1>- Returns:
- the configured command
-