public class JobHandler extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JobHandler.Cardinality
Possible job cardinalities.
|
| Constructor and Description |
|---|
JobHandler(org.camunda.bpm.engine.ProcessEngine processEngine,
String activityId) |
JobHandler(org.camunda.bpm.engine.ProcessEngine processEngine,
String activityId,
JobHandler.Cardinality cardinality)
Creates a new job handler.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
apply(org.camunda.bpm.engine.runtime.ProcessInstance pi) |
JobHandler |
customize(Consumer<JobHandler> customizer)
Customizes the handler, using the given
Consumer function. |
void |
execute()
Executes the job with an action that calls
executeJob. |
void |
execute(Consumer<org.camunda.bpm.engine.runtime.Job> action)
Executes a custom action that handles the job.
|
protected void |
execute(org.camunda.bpm.engine.runtime.Job job) |
JobHandler |
verify(BiConsumer<org.camunda.bpm.engine.test.assertions.bpmn.ProcessInstanceAssert,org.camunda.bpm.engine.test.assertions.bpmn.JobAssert> verifier)
Verifies the job's waiting state.
|
public JobHandler(org.camunda.bpm.engine.ProcessEngine processEngine,
String activityId)
public JobHandler(org.camunda.bpm.engine.ProcessEngine processEngine,
String activityId,
JobHandler.Cardinality cardinality)
processEngine - The used process engine.activityId - The ID of the related activity.cardinality - Expected job cardinality.protected void apply(org.camunda.bpm.engine.runtime.ProcessInstance pi)
public JobHandler customize(Consumer<JobHandler> customizer)
Consumer function. This method can be used to
apply a common customization needed for different test cases.
tc.handleJob().customize(this::prepareJob);
customizer - A function that accepts a JobHandler.public void execute()
executeJob.ManagementService.executeJob(String)public void execute(Consumer<org.camunda.bpm.engine.runtime.Job> action)
action - A specific action that accepts the related Job.protected void execute(org.camunda.bpm.engine.runtime.Job job)
public JobHandler verify(BiConsumer<org.camunda.bpm.engine.test.assertions.bpmn.ProcessInstanceAssert,org.camunda.bpm.engine.test.assertions.bpmn.JobAssert> verifier)
verifier - Verifier that accepts an ProcessInstanceAssert and an JobAssert
instance.Copyright © 2023 Camunda Services GmbH. All rights reserved.