Package io.camunda.client.impl.command
Class CreateBatchOperationCommandImpl<E extends TypedFilterableRequest.SearchRequestFilter>
java.lang.Object
io.camunda.client.impl.command.CreateBatchOperationCommandImpl<E>
- All Implemented Interfaces:
CreateBatchOperationCommandStep1.CreateBatchOperationCommandStep2<E>,CreateBatchOperationCommandStep1.CreateBatchOperationCommandStep3<E>,CreateBatchOperationCommandStep1.ProcessInstanceMigrationStep<E>,CreateBatchOperationCommandStep1.ProcessInstanceModificationStep<E>,FinalCommandStep<CreateBatchOperationResponse>
public class CreateBatchOperationCommandImpl<E extends TypedFilterableRequest.SearchRequestFilter>
extends Object
implements CreateBatchOperationCommandStep1.ProcessInstanceMigrationStep<E>, CreateBatchOperationCommandStep1.CreateBatchOperationCommandStep2<E>, CreateBatchOperationCommandStep1.ProcessInstanceModificationStep<E>, CreateBatchOperationCommandStep1.CreateBatchOperationCommandStep3<E>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Constructor Summary
ConstructorsConstructorDescriptionCreateBatchOperationCommandImpl(HttpClient httpClient, JsonMapper jsonMapper, BatchOperationTypeEnum type, Function<Consumer<E>, E> filterFactory) -
Method Summary
Modifier and TypeMethodDescriptionaddMappingInstruction(String sourceElementId, String targetElementId) Adds a single migration mapping instruction to the command.addMoveInstruction(String sourceElementId, String targetElementId) Adds a move instruction to the command.Sets the filter for the batch operation.Sets the filter for the batch operation.migrationPlan(MigrationPlan migrationPlan) Sets the whole migration plan for the batch operation.requestTimeout(Duration requestTimeout) Sets the request timeout for the command.send()Sends the command to the Camunda gateway.targetProcessDefinitionKey(long targetProcessDefinitionKey) Sets the target process definition key for the migration.Methods 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.FinalCommandStep
execute
-
Constructor Details
-
CreateBatchOperationCommandImpl
public CreateBatchOperationCommandImpl(HttpClient httpClient, JsonMapper jsonMapper, BatchOperationTypeEnum type, Function<Consumer<E>, E> filterFactory)
-
-
Method Details
-
filter
Description copied from interface:CreateBatchOperationCommandStep1.CreateBatchOperationCommandStep2Sets the filter for the batch operation.- Specified by:
filterin interfaceCreateBatchOperationCommandStep1.CreateBatchOperationCommandStep2<E extends TypedFilterableRequest.SearchRequestFilter>- Parameters:
filter- the filter to use- Returns:
- the builder for fluent use
-
filter
Description copied from interface:CreateBatchOperationCommandStep1.CreateBatchOperationCommandStep2Sets the filter for the batch operation. Uses a consumer to modify the default filter.- Specified by:
filterin interfaceCreateBatchOperationCommandStep1.CreateBatchOperationCommandStep2<E extends TypedFilterableRequest.SearchRequestFilter>- Parameters:
fn- the filter to use- Returns:
- the builder for fluent use
-
addMoveInstruction
public CreateBatchOperationCommandStep1.ProcessInstanceModificationStep<E> addMoveInstruction(String sourceElementId, String targetElementId) Description copied from interface:CreateBatchOperationCommandStep1.ProcessInstanceModificationStepAdds a move instruction to the command. These instructions will be applied to all matching sourceElementIds and create matching new targetElementId's tokens on all processInstances matching the filter.Example:
Given a process instance with the following structure:(start) -----> [ taskA ] -----> [ taskB ] ----> (end)
A running processInstance has an active elementtaskA.
When the following move instructions are applied:- sourceElementId:
taskA, targetElementId:taskB
taskAwill be terminated andtaskBwill be activated.- move instructions, matching no active source element will have no effect on the processInstance
- elements not matching any move instruction, will stay untouched
- when the processInstance has more than one active instance of a sourceElement, all sourceElements will be terminated and for each terminated element a new targetElement will be activated
- Specified by:
addMoveInstructionin interfaceCreateBatchOperationCommandStep1.ProcessInstanceModificationStep<E extends TypedFilterableRequest.SearchRequestFilter>- Returns:
- Returns a list of move instructions
- sourceElementId:
-
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<E extends TypedFilterableRequest.SearchRequestFilter>- 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<E extends TypedFilterableRequest.SearchRequestFilter>- Returns:
- a future tracking state of success/failure of the command.
-
migrationPlan
public CreateBatchOperationCommandStep1.ProcessInstanceMigrationStep<E> migrationPlan(MigrationPlan migrationPlan) Description copied from interface:CreateBatchOperationCommandStep1.ProcessInstanceMigrationStepSets the whole migration plan for the batch operation. The migration plan contains the detailed instructions how to migrate single active elements from the source process definition to the target process definition.- Specified by:
migrationPlanin interfaceCreateBatchOperationCommandStep1.ProcessInstanceMigrationStep<E extends TypedFilterableRequest.SearchRequestFilter>- Parameters:
migrationPlan- the migration plan to use for the batch operation- Returns:
- the builder for fluent use
-
addMappingInstruction
public CreateBatchOperationCommandStep1.ProcessInstanceMigrationStep<E> addMappingInstruction(String sourceElementId, String targetElementId) Description copied from interface:CreateBatchOperationCommandStep1.ProcessInstanceMigrationStepAdds a single migration mapping instruction to the command.- Specified by:
addMappingInstructionin interfaceCreateBatchOperationCommandStep1.ProcessInstanceMigrationStep<E extends TypedFilterableRequest.SearchRequestFilter>- Parameters:
sourceElementId- the id of the source element to migratetargetElementId- the id of the target element to migrate into- Returns:
- the builder for fluent use
-
targetProcessDefinitionKey
public CreateBatchOperationCommandStep1.ProcessInstanceMigrationStep<E> targetProcessDefinitionKey(long targetProcessDefinitionKey) Description copied from interface:CreateBatchOperationCommandStep1.ProcessInstanceMigrationStepSets the target process definition key for the migration.- Specified by:
targetProcessDefinitionKeyin interfaceCreateBatchOperationCommandStep1.ProcessInstanceMigrationStep<E extends TypedFilterableRequest.SearchRequestFilter>- Parameters:
targetProcessDefinitionKey- the key of the target process definition to migrate to- Returns:
- the builder for fluent use
-