Package io.zeebe.client.impl.command
Class CreateWorkflowInstanceCommandImpl
- java.lang.Object
-
- io.zeebe.client.impl.command.CreateWorkflowInstanceCommandImpl
-
- All Implemented Interfaces:
CreateWorkflowInstanceCommandStep1
,CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep2
,CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3
,FinalCommandStep<WorkflowInstanceEvent>
public final class CreateWorkflowInstanceCommandImpl extends Object implements CreateWorkflowInstanceCommandStep1, CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep2, CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.zeebe.client.api.command.CreateWorkflowInstanceCommandStep1
CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep2, CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3, CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceWithResultCommandStep1
-
-
Field Summary
-
Fields inherited from interface io.zeebe.client.api.command.CreateWorkflowInstanceCommandStep1
LATEST_VERSION
-
-
Constructor Summary
Constructors Constructor Description CreateWorkflowInstanceCommandImpl(GatewayGrpc.GatewayStub asyncStub, ZeebeObjectMapper objectMapper, Duration requestTimeout, Predicate<Throwable> retryPredicate)
-
Method Summary
-
-
-
Constructor Detail
-
CreateWorkflowInstanceCommandImpl
public CreateWorkflowInstanceCommandImpl(GatewayGrpc.GatewayStub asyncStub, ZeebeObjectMapper objectMapper, Duration requestTimeout, Predicate<Throwable> retryPredicate)
-
-
Method Detail
-
variables
public CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3 variables(InputStream variables)
Description copied from interface:CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3
Set the initial variables of the workflow instance.- Specified by:
variables
in interfaceCreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3
- Parameters:
variables
- the variables JSON document as stream- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send it to the broker.
-
variables
public CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3 variables(String variables)
Description copied from interface:CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3
Set the initial variables of the workflow instance.- Specified by:
variables
in interfaceCreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3
- Parameters:
variables
- the variables JSON document as String- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send it to the broker.
-
variables
public CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3 variables(Map<String,Object> variables)
Description copied from interface:CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3
Set the initial variables of the workflow instance.- Specified by:
variables
in interfaceCreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3
- Parameters:
variables
- the variables document as map- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send it to the broker.
-
variables
public CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3 variables(Object variables)
Description copied from interface:CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3
Set the initial variables of the workflow instance.- Specified by:
variables
in interfaceCreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3
- Parameters:
variables
- the variables document as object to be serialized to JSON- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send it to the broker.
-
withResult
public CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceWithResultCommandStep1 withResult()
Description copied from interface:CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3
When this method is called, the response to the command will be received after the workflow is completed. The response consists of a set of variables.- Specified by:
withResult
in interfaceCreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3
- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send it to the broker
-
bpmnProcessId
public CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep2 bpmnProcessId(String id)
Description copied from interface:CreateWorkflowInstanceCommandStep1
Set the BPMN process id of the workflow to create an instance of. This is the static id of the process in the BPMN XML (i.e. "<bpmn:process id='my-workflow'>").- Specified by:
bpmnProcessId
in interfaceCreateWorkflowInstanceCommandStep1
- Parameters:
id
- the BPMN process id of the workflow- Returns:
- the builder for this command
-
workflowKey
public CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3 workflowKey(long workflowKey)
Description copied from interface:CreateWorkflowInstanceCommandStep1
Set the key of the workflow to create an instance of. The key is assigned by the broker while deploying the workflow. It can be picked from the deployment or workflow event.- Specified by:
workflowKey
in interfaceCreateWorkflowInstanceCommandStep1
- Parameters:
workflowKey
- the key of the workflow- Returns:
- the builder for this command
-
version
public CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3 version(int version)
Description copied from interface:CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep2
Set the version of the workflow to create an instance of. The version is assigned by the broker while deploying the workflow. It can be picked from the deployment or workflow event.- Specified by:
version
in interfaceCreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep2
- Parameters:
version
- the version of the workflow- Returns:
- the builder for this command
-
latestVersion
public CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep3 latestVersion()
Description copied from interface:CreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep2
Use the latest version of the workflow to create an instance of.If the latest version was deployed few moments before then it can happen that the new instance is created of the previous version.
- Specified by:
latestVersion
in interfaceCreateWorkflowInstanceCommandStep1.CreateWorkflowInstanceCommandStep2
- Returns:
- the builder for this command
-
requestTimeout
public FinalCommandStep<WorkflowInstanceEvent> 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<WorkflowInstanceEvent>
- Parameters:
requestTimeout
- the request timeout- Returns:
- the configured command
-
send
public ZeebeFuture<WorkflowInstanceEvent> 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<WorkflowInstanceEvent>
- Returns:
- a future tracking state of success/failure of the command.
-
-