public class UserTaskHandler extends Object
| Constructor and Description |
|---|
UserTaskHandler(org.camunda.bpm.engine.ProcessEngine processEngine,
String activityId) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
apply(org.camunda.bpm.engine.runtime.ProcessInstance pi) |
void |
complete()
Completes the user task with an action that calls
complete. |
protected void |
complete(org.camunda.bpm.engine.task.Task task) |
UserTaskHandler |
customize(Consumer<UserTaskHandler> customizer)
Customizes the handler, using the given
Consumer function. |
void |
execute(Consumer<org.camunda.bpm.engine.task.Task> action)
Executes a custom action that handles the user task.
|
void |
handleBpmnError(String errorCode,
String errorMessage)
Continues the execution with an action that calls
handleBpmnError using the given error
code and message. |
protected void |
handleBpmnError(org.camunda.bpm.engine.task.Task task) |
void |
handleEscalation(String escalationCode)
Continues the execution with an action that calls
handleEscalation using the given
escalation code. |
protected void |
handleEscalation(org.camunda.bpm.engine.task.Task task) |
boolean |
isWaitingForBoundaryEvent()
Determines if the user task is waiting for a boundary message, signal or timer event.
|
UserTaskHandler |
verify(BiConsumer<org.camunda.bpm.engine.test.assertions.bpmn.ProcessInstanceAssert,org.camunda.bpm.engine.test.assertions.bpmn.TaskAssert> verifier)
Verifies the user task's waiting state.
|
void |
waitForBoundaryEvent()
Applies no action at the user task's wait state.
|
UserTaskHandler |
withErrorMessage(String errorMessage)
Sets the error message, which is used when the next activity is an error boundary event - in this
case the handler's default action is
handleBpmnError. |
UserTaskHandler |
withVariable(String name,
Object value)
Sets a variable, which is passed to the execution when a default action is used
(
complete(), handleBpmnError(String, String) or
handleEscalation(String)). |
UserTaskHandler |
withVariableTyped(String name,
org.camunda.bpm.engine.variable.value.TypedValue value)
Sets a typed variable, which is passed to the execution when a default action is used
(
complete(), handleBpmnError(String, String) or
handleEscalation(String)). |
public UserTaskHandler(org.camunda.bpm.engine.ProcessEngine processEngine,
String activityId)
protected void apply(org.camunda.bpm.engine.runtime.ProcessInstance pi)
public void complete()
complete.TaskService.complete(String, java.util.Map)protected void complete(org.camunda.bpm.engine.task.Task task)
public UserTaskHandler customize(Consumer<UserTaskHandler> customizer)
Consumer function. This method can be used to
apply a common customization needed for different test cases.
tc.handleUserTask().customize(this::prepareUserTask);
customizer - A function that accepts a UserTaskHandler.public void execute(Consumer<org.camunda.bpm.engine.task.Task> action)
action - A specific action that accepts the related Task.public void handleBpmnError(String errorCode, String errorMessage)
handleBpmnError using the given error
code and message.errorCode - The error code of the attached boundary error event.errorMessage - An error message or null.TaskService.handleBpmnError(String, String, String, java.util.Map)protected void handleBpmnError(org.camunda.bpm.engine.task.Task task)
public void handleEscalation(String escalationCode)
handleEscalation using the given
escalation code.escalationCode - The escalation code of the attached boundary escalation event.TaskService.handleEscalation(String, String, java.util.Map)protected void handleEscalation(org.camunda.bpm.engine.task.Task task)
public boolean isWaitingForBoundaryEvent()
true, if it is waiting for a boundary event. false, if not.public UserTaskHandler verify(BiConsumer<org.camunda.bpm.engine.test.assertions.bpmn.ProcessInstanceAssert,org.camunda.bpm.engine.test.assertions.bpmn.TaskAssert> verifier)
verifier - Verifier that accepts an ProcessInstanceAssert and an TaskAssert
instance.public void waitForBoundaryEvent()
public UserTaskHandler withErrorMessage(String errorMessage)
handleBpmnError.errorMessage - An error message or null.public UserTaskHandler withVariable(String name, Object value)
complete(), handleBpmnError(String, String) or
handleEscalation(String)).name - The name of the variable.value - The variable's value.public UserTaskHandler withVariableTyped(String name, org.camunda.bpm.engine.variable.value.TypedValue value)
complete(), handleBpmnError(String, String) or
handleEscalation(String)).name - The name of the variable.value - The variable's typed value.Copyright © 2023 Camunda Services GmbH. All rights reserved.