public class CallActivityHandler extends Object
| Constructor and Description |
|---|
CallActivityHandler(TestCaseInstance instance,
String activityId) |
| Modifier and Type | Method and Description |
|---|---|
CallActivityHandler |
customize(Consumer<CallActivityHandler> customizer)
Customizes the handler, using the given
Consumer function. |
protected boolean |
execute(org.camunda.bpm.engine.runtime.ProcessInstance pi,
org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution execution,
org.camunda.bpm.engine.impl.bpmn.behavior.CallActivityBehavior behavior)
Simulates the execution of a call activity.
|
boolean |
isWaitingForBoundaryEvent()
Determines if the call activity is waiting for a boundary message, signal or timer event.
|
void |
simulateBpmnError(String errorCode,
String errorMessage)
Simulates the occurrence of an error end event within the called sub instance.
|
void |
simulateEscalation(String escalationCode)
Simulates the occurrence of an escalation end event within the called sub instance.
|
CallActivityHandler |
verify(BiConsumer<org.camunda.bpm.engine.test.assertions.bpmn.ProcessInstanceAssert,CallActivityDefinition> verifier)
Verifies the definition of the call activity and the state before it is executed (actually before
the
mapInputVariables method of a possible DelegateVariableMapping is invoked). |
protected void |
verify(org.camunda.bpm.engine.runtime.ProcessInstance pi,
CallActivityDefinition callActivityDefinition) |
CallActivityHandler |
verifyInput(Consumer<org.camunda.bpm.engine.delegate.VariableScope> inputVerifier)
Verifies the state after the
mapInputVariables method of a possible
DelegateVariableMapping was invoked.Please note: This method can also be used to simulate the behavior of a called process. |
protected void |
verifyInput(org.camunda.bpm.engine.delegate.VariableScope variables) |
CallActivityHandler |
verifyOutput(Consumer<org.camunda.bpm.engine.delegate.VariableScope> outputVerifier)
Verifies the state after the
mapOutputVariables method of a possible
DelegateVariableMapping was invoked. |
protected void |
verifyOutput(org.camunda.bpm.engine.delegate.VariableScope variables) |
void |
waitForBoundaryEvent()
Lets the call activity become a wait state.
|
CallActivityHandler |
withErrorMessage(String errorMessage)
Sets the error message, which is used when the next activity is an error boundary event.
|
public CallActivityHandler(TestCaseInstance instance, String activityId)
public CallActivityHandler customize(Consumer<CallActivityHandler> customizer)
Consumer function. This method can be used to
apply a common customization needed for different test cases.
tc.handleCallActivity().customize(this::prepareCallActivity);
customizer - A function that accepts a CallActivityHandler.protected boolean execute(org.camunda.bpm.engine.runtime.ProcessInstance pi,
org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution execution,
org.camunda.bpm.engine.impl.bpmn.behavior.CallActivityBehavior behavior)
throws Exception
pi - The current process instance.execution - The current execution.behavior - The call activity's original behavior.true, if the execution should leave (continue). false, if the execution
should wait.Exception - Exception If the occurrence of an error end event is simulated and the error
propagation fails.public boolean isWaitingForBoundaryEvent()
true, if it is waiting for a boundary event. false, if not.public void simulateBpmnError(String errorCode, String errorMessage)
errorCode - The error code of the attached boundary error event.errorMessage - An error message or null.public void simulateEscalation(String escalationCode)
escalationCode - The escalation code of the attached boundary escalation event.public CallActivityHandler verify(BiConsumer<org.camunda.bpm.engine.test.assertions.bpmn.ProcessInstanceAssert,CallActivityDefinition> verifier)
mapInputVariables method of a possible DelegateVariableMapping is invoked).verifier - Verifier that accepts an ProcessInstanceAssert and an
CallActivityDefinition instance.protected void verify(org.camunda.bpm.engine.runtime.ProcessInstance pi,
CallActivityDefinition callActivityDefinition)
public CallActivityHandler verifyInput(Consumer<org.camunda.bpm.engine.delegate.VariableScope> inputVerifier)
mapInputVariables method of a possible
DelegateVariableMapping was invoked.mapOutputVariables method of a possible
DelegateVariableMapping is invoked.inputVerifier - Verifier that accepts the VariableScope of the sub process instance.protected void verifyInput(org.camunda.bpm.engine.delegate.VariableScope variables)
public CallActivityHandler verifyOutput(Consumer<org.camunda.bpm.engine.delegate.VariableScope> outputVerifier)
mapOutputVariables method of a possible
DelegateVariableMapping was invoked.outputVerifier - Verifier that accepts the VariableScope of the super execution.protected void verifyOutput(org.camunda.bpm.engine.delegate.VariableScope variables)
public void waitForBoundaryEvent()
public CallActivityHandler withErrorMessage(String errorMessage)
errorMessage - An error message or null.Copyright © 2023 Camunda Services GmbH. All rights reserved.