Class CreateProcessInstanceCommandImpl
- All Implemented Interfaces:
CommandWithCommunicationApiStep<CreateProcessInstanceCommandStep1>,CommandWithTenantStep<CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3>,CreateProcessInstanceCommandStep1,CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep2,CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3,FinalCommandStep<ProcessInstanceEvent>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.zeebe.client.api.command.CreateProcessInstanceCommandStep1
CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep2, CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3, CreateProcessInstanceCommandStep1.CreateProcessInstanceWithResultCommandStep1 -
Field Summary
Fields inherited from class io.camunda.zeebe.client.impl.command.CommandWithVariables
objectMapperFields inherited from interface io.camunda.zeebe.client.api.command.CommandWithTenantStep
DEFAULT_TENANT_IDENTIFIERFields inherited from interface io.camunda.zeebe.client.api.command.CreateProcessInstanceCommandStep1
LATEST_VERSION -
Constructor Summary
ConstructorsConstructorDescriptionCreateProcessInstanceCommandImpl(GatewayGrpc.GatewayStub asyncStub, JsonMapper jsonMapper, ZeebeClientConfiguration config, Predicate<CredentialsProvider.StatusCode> retryPredicate, HttpClient httpClient, boolean preferRestOverGrpc) CreateProcessInstanceCommandImpl(GatewayGrpc.GatewayStub asyncStub, JsonMapper jsonMapper, Duration requestTimeout, Predicate<CredentialsProvider.StatusCode> retryPredicate) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbpmnProcessId(String id) Set the BPMN process id of the process to create an instance of.Use the latest version of the process to create an instance of.processDefinitionKey(long processDefinitionKey) Set the key of the process to create an instance of.requestTimeout(Duration requestTimeout) Sets the request timeout for the command.send()Sends the command to the Zeebe broker.protected CreateProcessInstanceCommandImplsetVariablesInternal(String variables) startBeforeElement(String elementId) Overrides the default start position of the process.Specifies the tenant that will own any entities (e.g. process definition, process instances, etc.) resulting from this command, or that owns any entities (e.g. jobs) referred to from this command.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.version(int version) Set the version of the process to create an instance of.When this method is called, the response to the command will be received after the process is completed.Methods inherited from class io.camunda.zeebe.client.impl.command.CommandWithVariables
variable, variables, variables, variables, variables
-
Constructor Details
-
CreateProcessInstanceCommandImpl
public CreateProcessInstanceCommandImpl(GatewayGrpc.GatewayStub asyncStub, JsonMapper jsonMapper, ZeebeClientConfiguration config, Predicate<CredentialsProvider.StatusCode> retryPredicate, HttpClient httpClient, boolean preferRestOverGrpc) -
CreateProcessInstanceCommandImpl
public CreateProcessInstanceCommandImpl(GatewayGrpc.GatewayStub asyncStub, JsonMapper jsonMapper, Duration requestTimeout, Predicate<CredentialsProvider.StatusCode> retryPredicate) Deprecated.since 8.3.0, useinvalid reference
CreateProcessInstanceCommandImpl#CreateProcessInstanceCommandImpl(GatewayStub asyncStub, JsonMapper jsonMapper, ZeebeClientConfiguration config, Predicate retryPredicate)A constructor that provides an instance with thetenantId set.From version 8.3.0, the java client supports multi-tenancy for this command, which requires the
tenantIdproperty to be defined. This constructor is only intended for backwards compatibility in tests.
-
-
Method Details
-
setVariablesInternal
- Specified by:
setVariablesInternalin classCommandWithVariables<CreateProcessInstanceCommandImpl>
-
startBeforeElement
public CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3 startBeforeElement(String elementId) Description copied from interface:CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3Overrides the default start position of the process. Calling this method will make the process start at the givenelementId, if possible. This method can be called more than once to simultaneously start at different elements in different branches of the process.- Specified by:
startBeforeElementin interfaceCreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3- Parameters:
elementId- the id of the BPMN element where to start the process instance- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send * it to the broker.
-
withResult
Description copied from interface:CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3When this method is called, the response to the command will be received after the process is completed. The response consists of a set of variables.- Specified by:
withResultin interfaceCreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker
-
bpmnProcessId
Description copied from interface:CreateProcessInstanceCommandStep1Set the BPMN process id of the process to create an instance of. This is the static id of the process in the BPMN XML (i.e. "<bpmn:process id='my-process'>").- Specified by:
bpmnProcessIdin interfaceCreateProcessInstanceCommandStep1- Parameters:
id- the BPMN process id of the process- Returns:
- the builder for this command
-
processDefinitionKey
public CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3 processDefinitionKey(long processDefinitionKey) Description copied from interface:CreateProcessInstanceCommandStep1Set the key of the process to create an instance of. The key is assigned by the broker while deploying the process. It can be picked from the deployment or process event.- Specified by:
processDefinitionKeyin interfaceCreateProcessInstanceCommandStep1- Parameters:
processDefinitionKey- the key of the process- Returns:
- the builder for this command
-
version
Description copied from interface:CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep2Set the version of the process to create an instance of. The version is assigned by the broker while deploying the process. It can be picked from the deployment or process event.- Specified by:
versionin interfaceCreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep2- Parameters:
version- the version of the process- Returns:
- the builder for this command
-
latestVersion
Description copied from interface:CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep2Use the latest version of the process 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:
latestVersionin interfaceCreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep2- 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 usingZeebeClientBuilder.defaultRequestTimeout(Duration).- Specified by:
requestTimeoutin interfaceFinalCommandStep<ProcessInstanceEvent>- Parameters:
requestTimeout- the request timeout- Returns:
- the configured command
-
send
Description copied from interface:FinalCommandStepSends 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<JobEventinvalid input: '>' future = command.send(); JobEvent event = future.join();- Specified by:
sendin interfaceFinalCommandStep<ProcessInstanceEvent>- Returns:
- a future tracking state of success/failure of the command.
-
tenantId
public CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3 tenantId(String tenantId) Description copied from interface:CommandWithTenantStepSpecifies the tenant that will own any entities (e.g. process definition, process instances, etc.) resulting from this command, or that owns any entities (e.g. jobs) referred to from this command.Multi-tenancy
Multiple tenants can share a Zeebe cluster. Entities can be assigned to a specific tenant using an identifier. Only that tenant can access these entities.
Any entities created before multi-tenancy has been enabled in the Zeebe cluster, are assigned to the
CommandWithTenantStep.DEFAULT_TENANT_IDENTIFIER.If no tenant is explicitly specified, then the command is rejected.
- Specified by:
tenantIdin interfaceCommandWithTenantStep<CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3>- Parameters:
tenantId- the identifier of the tenant to specify for this command, e.g."ACME"- Returns:
- the builder for this command with the tenant 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 Zeebe, 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 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
ZeebeClientBuilder.preferRestOverGrpc(boolean).- Specified by:
useRestin interfaceCommandWithCommunicationApiStep<CreateProcessInstanceCommandStep1>- 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 Zeebe, 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
ZeebeClientBuilder.preferRestOverGrpc(boolean).- Specified by:
useGrpcin interfaceCommandWithCommunicationApiStep<CreateProcessInstanceCommandStep1>- Returns:
- the configured command
-
invalid reference