camunda / camunda-bpm-platform

Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Quarkus, Spring, Spring Boot, CDI.
https://camunda.com/
Apache License 2.0
4.12k stars 1.56k forks source link

Cryptic NullPointerException when ending Sub Process with output parameters, but no outgoing arrows #2270

Open ThorbenLindhauer opened 5 years ago

ThorbenLindhauer commented 5 years ago

This issue was imported from JIRA:

Field Value
JIRA Link CAM-10580
Reporter Lbk8JgO
What is this name? This pseudonym name was generated based on the user name in JIRA to protect the personal data of our JIRA users. You can use this identifier to search for issues by the same reporter.
Has restricted visibility comments true

Given: Any BPMN process with a Sub Process with output parameters, but no outgoing arrows.

When: The process is started.

Then: The engine throws an exception:

Runtime result:
05-Jul-2019 12:30:55.904 SEVERE <http-nio-8080-exec-7> org.camunda.commons.logging.BaseLogger.logError ENGINE-16004 Exception while closing command context: null
 java.lang.NullPointerException
        at org.camunda.bpm.engine.impl.core.variable.mapping.OutputParameter.execute(OutputParameter.java:52)
        at org.camunda.bpm.engine.impl.core.variable.mapping.IoParameter.execute(IoParameter.java:51)
        at org.camunda.bpm.engine.impl.core.variable.mapping.IoMapping.executeOutputParameters(IoMapping.java:45)
        at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.destroy(ExecutionEntity.java:531)
        at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationProcessEnd.eventNotificationsCompleted(PvmAtomicOperationProcessEnd.java:83)
        at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationProcessEnd.eventNotificationsCompleted(PvmAtomicOperationProcessEnd.java:33)
        at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:66)
(...)

Expected:

The output parameters are executed without throwing an exception.

Note:

Links:

ThorbenLindhauer commented 5 years ago

This comment was imported from JIRA and written by user Lbk8JgO

What is this name? This pseudonym name was generated based on the user name in JIRA to protect the personal data of our JIRA users. You can use this identifier to search for issues by the same reporter.


https://github.com/camunda/camunda-bpm-platform/blob/master/engine/src/main/java/org/camunda/bpm/engine/impl/core/variable/mapping/OutputParameter.java

Line 52.

It seems to me that outerScope is null in this case.

ThorbenLindhauer commented 5 years ago

This comment was imported from JIRA and written by user @koevskinikola


Hi Lbk8JgO,

I have successfully replicated and understood the bug that you are reporting. I will forward it for a decision.

Best regards, Nikola

ThorbenLindhauer commented 5 years ago

This comment was imported from JIRA and written by user @ThorbenLindhauer


Hello Bram,

Thanks for reporting this. I have updated the expected behavior. The ouput parameters should be executed in this case. E.g. there could be an execution listener on process level that works with them and they should show up in the history tables.

We will see if we can fix it this bug 7.12, but can't promise it. We would also be very happy to receive a contribution.

Cheers, Thorben