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<Throwable> retryPredicate) -
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.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<Throwable> retryPredicate)
-
-
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.
-