Class MigrateProcessInstanceCommandImpl
java.lang.Object
io.camunda.zeebe.client.impl.command.MigrateProcessInstanceCommandImpl
- All Implemented Interfaces:
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, Duration requestTimeout, Predicate<CredentialsProvider.StatusCode> retryPredicate) -
Method Summary
Modifier and TypeMethodDescriptionaddMappingInstruction(String sourceElementId, String targetElementId) Add aGatewayOuterClass.MigrateProcessInstanceRequest.MappingInstructionfor the element that will be migrated and its target element id in the target process definition.migrationPlan(long targetProcessDefinitionKey) Create a MigrationPlanGatewayOuterClass.MigrateProcessInstanceRequest.MigrationPlanfor the given target process definition key.migrationPlan(MigrationPlan migrationPlan) Use the provided MigrationPlan from the givenMigrationPlanobject.requestTimeout(Duration requestTimeout) Sets the request timeout for the command.send()Sends the command to the Zeebe broker.
-
Constructor Details
-
MigrateProcessInstanceCommandImpl
public MigrateProcessInstanceCommandImpl(long processInstanceKey, GatewayGrpc.GatewayStub asyncStub, Duration requestTimeout, Predicate<CredentialsProvider.StatusCode> retryPredicate)
-
-
Method Details
-
migrationPlan
public MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep migrationPlan(long targetProcessDefinitionKey) Description copied from interface:MigrateProcessInstanceCommandStep1Create a MigrationPlanGatewayOuterClass.MigrateProcessInstanceRequest.MigrationPlanfor the given target process definition key.- Specified by:
migrationPlanin 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:MigrateProcessInstanceCommandStep1Use the provided MigrationPlan from the givenMigrationPlanobject.Example MigrationPlan object creation:
final MigrationPlan migrationPlan = MigrationPlan.newBuilder() .withTargetProcessDefinitionKey(2L) .addMappingInstruction("element1", "element2") .addMappingInstruction("element3", "element4") .build();- Specified by:
migrationPlanin 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.MigrateProcessInstanceCommandFinalStepAdd aGatewayOuterClass.MigrateProcessInstanceRequest.MappingInstructionfor 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:
addMappingInstructionin interfaceMigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep- Specified by:
addMappingInstructionin 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:FinalCommandStepSets the request timeout for the command. The default request timeout can be configured usingZeebeClientBuilder.defaultRequestTimeout(Duration).- Specified by:
requestTimeoutin interfaceFinalCommandStep<MigrateProcessInstanceResponse>- 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<MigrateProcessInstanceResponse>- Returns:
- a future tracking state of success/failure of the command.
-