Expected Call Activity Out Parameter behavior when BPMNError thrown

Consider this simple process:

With the following call activity definition:

Call Activity

<callActivity calledElement="sub_process_with_java_delegate">
        <flowable:out source="clientName" target="clientName"></flowable:out>

Java Delegate in called process

public class DoBadThings implements JavaDelegate {
  public void execute(DelegateExecution execution) {
    execution.setVariable("clientName", "Jane Doe");
    throw new BPMNError("BAD");

Should clientName be available for the user task?

If not:

  1. is there documentation explaining this
  2. is there a way to persist across the error boundary event?

If so, we have a project in which the mapping doesn’t seem to be taking place in this scenario and I would be happy to provide further details if needed.

By default, it won’t be available. The reason is that a call activity uses an in/out mapping for it’s variables. So:

  • Have you tried providing an/in out mapping? (not sure if this works when using a BpmnError).
  • Otherwise, you can get the parent process instance from your execution, and set the variable on that process instance instead of the one for the called one in the call activity.