Class CreateProcessInstanceCommandImpl
- All Implemented Interfaces:
CommandWithCommunicationApiStep<CreateProcessInstanceCommandStep1>,CommandWithTenantStep<CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3>,CommandWithVariables<CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3>,CreateProcessInstanceCommandStep1,CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep2,CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3,FinalCommandStep<ProcessInstanceEvent>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.client.api.command.CreateProcessInstanceCommandStep1
CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep2, CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3, CreateProcessInstanceCommandStep1.CreateProcessInstanceWithResultCommandStep1 -
Field Summary
Fields inherited from class io.camunda.client.impl.command.CommandWithVariables
objectMapperFields inherited from interface io.camunda.client.api.command.CommandWithTenantStep
DEFAULT_TENANT_IDENTIFIERFields inherited from interface io.camunda.client.api.command.CreateProcessInstanceCommandStep1
LATEST_VERSION -
Constructor Summary
ConstructorsConstructorDescriptionCreateProcessInstanceCommandImpl(io.camunda.zeebe.gateway.protocol.GatewayGrpc.GatewayStub asyncStub, JsonMapper jsonMapper, CamundaClientConfiguration config, Predicate<CredentialsProvider.StatusCode> retryPredicate, HttpClient httpClient, boolean preferRestOverGrpc) -
Method Summary
Modifier and TypeMethodDescriptionbpmnProcessId(String id) Set the BPMN process id of the process to create an instance of.businessId(String businessId) Set the business id of the process instance to be created.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 Camunda gateway.protected CreateProcessInstanceCommandImplsetVariablesInternal(String variables) startBeforeElement(String elementId) Overrides the default start position of the process.Add tags to the process instance to be created.Add tags to the process instance to be created.Set the tags of the process instance to be created.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.terminateAfterElement(String elementId) Adds a runtime instruction to terminate the process instance after the given element is completed or terminated.useGrpc()Sets gRPC as the communication API for this command.useRest()Sets REST as the communication API for this command.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.client.impl.command.CommandWithVariables
variable, variables, variables, variables, variablesMethods 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.CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3
variable, variables, variables, variables, variablesMethods inherited from interface io.camunda.client.api.command.FinalCommandStep
execute
-
Constructor Details
-
CreateProcessInstanceCommandImpl
public CreateProcessInstanceCommandImpl(io.camunda.zeebe.gateway.protocol.GatewayGrpc.GatewayStub asyncStub, JsonMapper jsonMapper, CamundaClientConfiguration config, Predicate<CredentialsProvider.StatusCode> retryPredicate, HttpClient httpClient, boolean preferRestOverGrpc)
-
-
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.
-
terminateAfterElement
public CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3 terminateAfterElement(String elementId) Description copied from interface:CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3Adds a runtime instruction to terminate the process instance after the given element is completed or terminated. This method can be called more than once to add multiple runtime instructions.- Specified by:
terminateAfterElementin interfaceCreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3- Parameters:
elementId- the id of the BPMN element after which the process instance should be terminated- 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
-
tags
Description copied from interface:CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3Add tags to the process instance to be created.Tags are de-duplicated. Each tag must follow this format:
- Start with a letter (a-z, A-Z)
- Subsequent characters may be letters, digits, underscore (_), minus (-), colon (:), or period (.)
- Length between 1 and 100 characters
- Must not be
nullor blank
- Specified by:
tagsin interfaceCreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3- Parameters:
tags- one or more tag values- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
tags
public CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3 tags(Iterable<String> tags) Description copied from interface:CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3Add tags to the process instance to be created.Tags are de-duplicated. Each tag must follow this format:
- Start with a letter (a-z, A-Z)
- Subsequent characters may be letters, digits, underscore (_), minus (-), colon (:), or period (.)
- Length between 1 and 100 characters
- Must not be
nullor blank
- Specified by:
tagsin interfaceCreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3- Parameters:
tags- a collection of tag values- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
tags
Description copied from interface:CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3Set the tags of the process instance to be created.Duplicates are naturally excluded by the
Setcontract. Each tag must follow this format:- Start with a letter (a-z, A-Z)
- Subsequent characters may be letters, digits, underscore (_), minus (-), colon (:), or period (.)
- Length between 1 and 100 characters
- Must not be
nullor blank
- Specified by:
tagsin interfaceCreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3- Parameters:
tags- the set of tag values to apply- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
businessId
public CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3 businessId(String businessId) Description copied from interface:CreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3Set the business id of the process instance to be created.The business id is an optional, user-defined string identifier that identifies the process instance within the scope of a process definition (scoped by tenant).
If provided and uniqueness enforcement is enabled, the engine will reject creation if another root process instance with the same business id is already active for the same process definition.
Note that any active child process instances with the same business id are not taken into account.
- Specified by:
businessIdin interfaceCreateProcessInstanceCommandStep1.CreateProcessInstanceCommandStep3- Parameters:
businessId- the business id to set- 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 usingCamundaClientBuilder.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 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<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 Camunda 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 Camunda 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:CommandWithCommunicationApiStepSets 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 usingCamundaClientBuilder.preferRestOverGrpc(boolean).- Specified by:
useRestin interfaceCommandWithCommunicationApiStep<CreateProcessInstanceCommandStep1>- Returns:
- the configured command
-
useGrpc
Description copied from interface:CommandWithCommunicationApiStepSets 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 usingCamundaClientBuilder.preferRestOverGrpc(boolean).- Specified by:
useGrpcin interfaceCommandWithCommunicationApiStep<CreateProcessInstanceCommandStep1>- Returns:
- the configured command
-