Class SetVariablesCommandImpl
- All Implemented Interfaces:
CommandWithCommunicationApiStep<SetVariablesCommandStep1>,CommandWithOperationReferenceStep<SetVariablesCommandStep1.SetVariablesCommandStep2>,FinalCommandStep<SetVariablesResponse>,SetVariablesCommandStep1,SetVariablesCommandStep1.SetVariablesCommandStep2
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.client.api.command.SetVariablesCommandStep1
SetVariablesCommandStep1.SetVariablesCommandStep2 -
Constructor Summary
ConstructorsConstructorDescriptionSetVariablesCommandImpl(GatewayGrpc.GatewayStub asyncStub, JsonMapper jsonMapper, long elementInstanceKey, Duration requestTimeout, Predicate<CredentialsProvider.StatusCode> retryPredicate, HttpClient httpClient, boolean preferRestOverGrpc) -
Method Summary
Modifier and TypeMethodDescriptionlocal(boolean local) If true, the variables will be merged strictly into the local scope (as indicated by elementInstanceKey); this means the variables is not propagated to upper scopes.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.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.variables(InputStream variables) Sets the variables document from a JSON stream.Sets the variables document from an object, which will be serialized into a JSON document.Sets the variables document from a JSON string.Sets the variables document from a map.
-
Constructor Details
-
SetVariablesCommandImpl
public SetVariablesCommandImpl(GatewayGrpc.GatewayStub asyncStub, JsonMapper jsonMapper, long elementInstanceKey, 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<SetVariablesResponse>- 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<SetVariablesResponse>- Returns:
- a future tracking state of success/failure of the command.
-
local
Description copied from interface:SetVariablesCommandStep1.SetVariablesCommandStep2If true, the variables will be merged strictly into the local scope (as indicated by elementInstanceKey); this means the variables is not propagated to upper scopes.For example, let's say we have two scopes, '1' and '2', with each having effective variables as:
- 1 => `{ "foo" : 2 }`
- 2 => `{ "bar" : 1 }`
If we send an update request with elementInstanceKey = 2, a new document of `{ "foo" : 5 }`, and local is true, then scope 1 will be unchanged, and scope 2 will now be `{ "bar" : 1, "foo" 5 }`.
If local was false, however, then scope 1 would be `{ "foo": 5 }`, and scope 2 would be `{ "bar" : 1 }`.
- Specified by:
localin interfaceSetVariablesCommandStep1.SetVariablesCommandStep2- Parameters:
local- whether or not to update only the local scope- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
variables
Description copied from interface:SetVariablesCommandStep1Sets the variables document from a JSON stream.- Specified by:
variablesin interfaceSetVariablesCommandStep1- Parameters:
variables- the variables JSON document as stream- Returns:
- the builder for this command. Call
to complete the command and send it to the broker.
invalid reference
#send()
-
variables
Description copied from interface:SetVariablesCommandStep1Sets the variables document from a JSON string.- Specified by:
variablesin interfaceSetVariablesCommandStep1- Parameters:
variables- the variables JSON document as String- Returns:
- the builder for this command. Call
to complete the command and send it to the broker.
invalid reference
#send()
-
variables
Description copied from interface:SetVariablesCommandStep1Sets the variables document from a map.- Specified by:
variablesin interfaceSetVariablesCommandStep1- Parameters:
variables- the variables document as map- Returns:
- the builder for this command. Call
to complete the command and send it to the broker.
invalid reference
#send()
-
variables
Description copied from interface:SetVariablesCommandStep1Sets the variables document from an object, which will be serialized into a JSON document.- Specified by:
variablesin interfaceSetVariablesCommandStep1- Parameters:
variables- the variables document as object- Returns:
- the builder for this command. Call
to complete the command and send it to the broker.
invalid reference
#send()
-
operationReference
public SetVariablesCommandStep1.SetVariablesCommandStep2 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<SetVariablesCommandStep1.SetVariablesCommandStep2>- 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<SetVariablesCommandStep1>- 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<SetVariablesCommandStep1>- Returns:
- the configured command
-