Package io.zeebe.client.impl.command
Class SetVariablesCommandImpl
- java.lang.Object
-
- io.zeebe.client.impl.command.SetVariablesCommandImpl
-
- All Implemented Interfaces:
FinalCommandStep<SetVariablesResponse>
,SetVariablesCommandStep1
,SetVariablesCommandStep1.SetVariablesCommandStep2
public final class SetVariablesCommandImpl extends Object implements SetVariablesCommandStep1, SetVariablesCommandStep1.SetVariablesCommandStep2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.zeebe.client.api.command.SetVariablesCommandStep1
SetVariablesCommandStep1.SetVariablesCommandStep2
-
-
Constructor Summary
Constructors Constructor Description SetVariablesCommandImpl(GatewayGrpc.GatewayStub asyncStub, ZeebeObjectMapper objectMapper, long elementInstanceKey, Duration requestTimeout, Predicate<Throwable> retryPredicate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SetVariablesCommandStep1.SetVariablesCommandStep2
local(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.FinalCommandStep<SetVariablesResponse>
requestTimeout(Duration requestTimeout)
Sets the request timeout for the command.ZeebeFuture<SetVariablesResponse>
send()
Sends the command to the Zeebe broker.SetVariablesCommandStep1.SetVariablesCommandStep2
variables(InputStream variables)
Sets the variables document from a JSON stream.SetVariablesCommandStep1.SetVariablesCommandStep2
variables(Object variables)
Sets the variables document from an object, which will be serialized into a JSON document.SetVariablesCommandStep1.SetVariablesCommandStep2
variables(String variables)
Sets the variables document from a JSON string.SetVariablesCommandStep1.SetVariablesCommandStep2
variables(Map<String,Object> variables)
Sets the variables document from a map.
-
-
-
Constructor Detail
-
SetVariablesCommandImpl
public SetVariablesCommandImpl(GatewayGrpc.GatewayStub asyncStub, ZeebeObjectMapper objectMapper, long elementInstanceKey, Duration requestTimeout, Predicate<Throwable> retryPredicate)
-
-
Method Detail
-
requestTimeout
public FinalCommandStep<SetVariablesResponse> requestTimeout(Duration requestTimeout)
Description copied from interface:FinalCommandStep
Sets the request timeout for the command. The default request timeout can be configured usingZeebeClientBuilder.defaultRequestTimeout(Duration)
.- Specified by:
requestTimeout
in interfaceFinalCommandStep<SetVariablesResponse>
- Parameters:
requestTimeout
- the request timeout- Returns:
- the configured command
-
send
public ZeebeFuture<SetVariablesResponse> send()
Description copied from interface:FinalCommandStep
Sends the command to the Zeebe broker. This operation is asynchronous. In case of success, the future returns the event that was generated by the Zeebe broker in response to the command.Call
ZeebeFuture.join()
to wait until the response is available.Future<JobEvent> future = command.send(); JobEvent event = future.join();
- Specified by:
send
in interfaceFinalCommandStep<SetVariablesResponse>
- Returns:
- a future tracking state of success/failure of the command.
-
local
public SetVariablesCommandStep1.SetVariablesCommandStep2 local(boolean local)
Description copied from interface:SetVariablesCommandStep1.SetVariablesCommandStep2
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.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:
local
in 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
public SetVariablesCommandStep1.SetVariablesCommandStep2 variables(InputStream variables)
Description copied from interface:SetVariablesCommandStep1
Sets the variables document from a JSON stream.- Specified by:
variables
in interfaceSetVariablesCommandStep1
- Parameters:
variables
- the variables JSON document as stream- Returns:
- the builder for this command. Call
#send()
to complete the command and send it to the broker.
-
variables
public SetVariablesCommandStep1.SetVariablesCommandStep2 variables(String variables)
Description copied from interface:SetVariablesCommandStep1
Sets the variables document from a JSON string.- Specified by:
variables
in interfaceSetVariablesCommandStep1
- Parameters:
variables
- the variables JSON document as String- Returns:
- the builder for this command. Call
#send()
to complete the command and send it to the broker.
-
variables
public SetVariablesCommandStep1.SetVariablesCommandStep2 variables(Map<String,Object> variables)
Description copied from interface:SetVariablesCommandStep1
Sets the variables document from a map.- Specified by:
variables
in interfaceSetVariablesCommandStep1
- Parameters:
variables
- the variables document as map- Returns:
- the builder for this command. Call
#send()
to complete the command and send it to the broker.
-
variables
public SetVariablesCommandStep1.SetVariablesCommandStep2 variables(Object variables)
Description copied from interface:SetVariablesCommandStep1
Sets the variables document from an object, which will be serialized into a JSON document.- Specified by:
variables
in interfaceSetVariablesCommandStep1
- Parameters:
variables
- the variables document as object- Returns:
- the builder for this command. Call
#send()
to complete the command and send it to the broker.
-
-