Package io.camunda.client.impl.command
Class CreateBatchOperationCommandImpl<E extends TypedSearchRequest.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 TypedSearchRequest.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) 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) requestTimeout(Duration requestTimeout) Sets the request timeout for the command.send()Sends the command to the Camunda gateway.targetProcessDefinitionKey(long targetProcessDefinitionKey)
-
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 TypedSearchRequest.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 TypedSearchRequest.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 TypedSearchRequest.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 TypedSearchRequest.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 TypedSearchRequest.SearchRequestFilter>- Returns:
- a future tracking state of success/failure of the command.
-
migrationPlan
public CreateBatchOperationCommandStep1.ProcessInstanceMigrationStep<E> migrationPlan(MigrationPlan migrationPlan) - Specified by:
migrationPlanin interfaceCreateBatchOperationCommandStep1.ProcessInstanceMigrationStep<E extends TypedSearchRequest.SearchRequestFilter>
-
addMappingInstruction
public CreateBatchOperationCommandStep1.ProcessInstanceMigrationStep<E> addMappingInstruction(String sourceElementId, String targetElementId) - Specified by:
addMappingInstructionin interfaceCreateBatchOperationCommandStep1.ProcessInstanceMigrationStep<E extends TypedSearchRequest.SearchRequestFilter>
-
targetProcessDefinitionKey
public CreateBatchOperationCommandStep1.ProcessInstanceMigrationStep<E> targetProcessDefinitionKey(long targetProcessDefinitionKey) - Specified by:
targetProcessDefinitionKeyin interfaceCreateBatchOperationCommandStep1.ProcessInstanceMigrationStep<E extends TypedSearchRequest.SearchRequestFilter>
-