Class MigrateProcessInstanceCommandImpl
java.lang.Object
io.camunda.zeebe.client.impl.command.MigrateProcessInstanceCommandImpl
- All Implemented Interfaces:
CommandWithCommunicationApiStep<MigrateProcessInstanceCommandStep1>
,CommandWithOperationReferenceStep<MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep>
,FinalCommandStep<MigrateProcessInstanceResponse>
,MigrateProcessInstanceCommandStep1
,MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep
,MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandStep2
public final class MigrateProcessInstanceCommandImpl
extends Object
implements MigrateProcessInstanceCommandStep1, MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.zeebe.client.api.command.MigrateProcessInstanceCommandStep1
MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep, MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandStep2
-
Constructor Summary
ConstructorsConstructorDescriptionMigrateProcessInstanceCommandImpl
(long processInstanceKey, GatewayGrpc.GatewayStub asyncStub, Predicate<CredentialsProvider.StatusCode> retryPredicate, HttpClient httpClient, ZeebeClientConfiguration config, JsonMapper jsonMapper) -
Method Summary
Modifier and TypeMethodDescriptionaddMappingInstruction
(String sourceElementId, String targetElementId) Add aGatewayOuterClass.MigrateProcessInstanceRequest.MappingInstruction
for the element that will be migrated and its target element id in the target process definition.migrationPlan
(long targetProcessDefinitionKey) Create a MigrationPlanGatewayOuterClass.MigrateProcessInstanceRequest.MigrationPlan
for the given target process definition key.migrationPlan
(MigrationPlan migrationPlan) Use the provided MigrationPlan from the givenMigrationPlan
object.operationReference
(long operationReference) Set the Operation Reference.requestTimeout
(Duration requestTimeout) Sets the request timeout for the command.send()
Sends the command to the Zeebe broker.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.
-
Constructor Details
-
MigrateProcessInstanceCommandImpl
public MigrateProcessInstanceCommandImpl(long processInstanceKey, GatewayGrpc.GatewayStub asyncStub, Predicate<CredentialsProvider.StatusCode> retryPredicate, HttpClient httpClient, ZeebeClientConfiguration config, JsonMapper jsonMapper)
-
-
Method Details
-
migrationPlan
public MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep migrationPlan(long targetProcessDefinitionKey) Description copied from interface:MigrateProcessInstanceCommandStep1
Create a MigrationPlanGatewayOuterClass.MigrateProcessInstanceRequest.MigrationPlan
for the given target process definition key.- Specified by:
migrationPlan
in interfaceMigrateProcessInstanceCommandStep1
- Parameters:
targetProcessDefinitionKey
- the key of the target process definition- Returns:
- the builder for this command
-
migrationPlan
public MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep migrationPlan(MigrationPlan migrationPlan) Description copied from interface:MigrateProcessInstanceCommandStep1
Use the provided MigrationPlan from the givenMigrationPlan
object.Example MigrationPlan object creation:
final MigrationPlan migrationPlan = MigrationPlan.newBuilder() .withTargetProcessDefinitionKey(2L) .addMappingInstruction("element1", "element2") .addMappingInstruction("element3", "element4") .build();
- Specified by:
migrationPlan
in interfaceMigrateProcessInstanceCommandStep1
- Parameters:
migrationPlan
- the object that contains migration plan data- Returns:
- the builder for this command
-
addMappingInstruction
public MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep addMappingInstruction(String sourceElementId, String targetElementId) Description copied from interface:MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep
Add aGatewayOuterClass.MigrateProcessInstanceRequest.MappingInstruction
for the element that will be migrated and its target element id in the target process definition. This method allows to add more than one mapping instructions to the migration plan.- Specified by:
addMappingInstruction
in interfaceMigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep
- Specified by:
addMappingInstruction
in interfaceMigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandStep2
- Parameters:
sourceElementId
- the element id to migrate fromtargetElementId
- the element id to migrate into- Returns:
- the builder for this command
-
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<MigrateProcessInstanceResponse>
- Parameters:
requestTimeout
- the request timeout- Returns:
- the configured command
-
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<JobEventinvalid input: '>' future = command.send(); JobEvent event = future.join();
- Specified by:
send
in interfaceFinalCommandStep<MigrateProcessInstanceResponse>
- Returns:
- a future tracking state of success/failure of the command.
-
operationReference
public MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep operationReference(long operationReference) Description copied from interface:CommandWithOperationReferenceStep
Set the Operation Reference.This is a key chosen by the user and will be part of all records resulted from this operation
- Specified by:
operationReference
in interfaceCommandWithOperationReferenceStep<MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep>
- 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:CommandWithCommunicationApiStep
Experimental: 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:
useRest
in interfaceCommandWithCommunicationApiStep<MigrateProcessInstanceCommandStep1>
- Returns:
- the configured command
-
useGrpc
Description copied from interface:CommandWithCommunicationApiStep
Experimental: 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:
useGrpc
in interfaceCommandWithCommunicationApiStep<MigrateProcessInstanceCommandStep1>
- Returns:
- the configured command
-