Class MigrateProcessInstanceCommandImpl
- All Implemented Interfaces:
CommandWithCommunicationApiStep<MigrateProcessInstanceCommandStep1>,CommandWithOperationReferenceStep<MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep>,FinalCommandStep<MigrateProcessInstanceResponse>,MigrateProcessInstanceCommandStep1,MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep,MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandStep2
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.client.api.command.MigrateProcessInstanceCommandStep1
MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep, MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandStep2 -
Constructor Summary
ConstructorsConstructorDescriptionMigrateProcessInstanceCommandImpl(long processInstanceKey, GatewayGrpc.GatewayStub asyncStub, Predicate<CredentialsProvider.StatusCode> retryPredicate, HttpClient httpClient, CamundaClientConfiguration config, JsonMapper jsonMapper) -
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.operationReference(long operationReference) Set the Operation Reference.requestTimeout(Duration requestTimeout) Sets the request timeout for the command.send()Sends the command to the Camunda gateway.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, CamundaClientConfiguration config, JsonMapper jsonMapper)
-
-
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 usingCamundaClientBuilder.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 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<MigrateProcessInstanceResponse>- Returns:
- a future tracking state of success/failure of the command.
-
operationReference
public MigrateProcessInstanceCommandStep1.MigrateProcessInstanceCommandFinalStep operationReference(long operationReference) Description copied from interface:CommandWithOperationReferenceStepSet the Operation Reference.This is a key chosen by the user and will be part of all records resulted from this operation
- Specified by:
operationReferencein 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: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 Camunda, and already wants to use this API during its development. As support for REST is added to Camunda, 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
CamundaClientBuilder.preferRestOverGrpc(boolean).- Specified by:
useRestin interfaceCommandWithCommunicationApiStep<MigrateProcessInstanceCommandStep1>- 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 Camunda, 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
CamundaClientBuilder.preferRestOverGrpc(boolean).- Specified by:
useGrpcin interfaceCommandWithCommunicationApiStep<MigrateProcessInstanceCommandStep1>- Returns:
- the configured command
-