BPMN20 XML import throws NullPointerException when no process is found
See original GitHub issueDescribe the bug I have designed a BPMN2.0 process model in Signavio modeller and exported it as BPMN 2.0 XML. When trying to import the XML into Flowable 6.4.2, the importer throws a NPE:
2019-12-17 15:36:03.256 ERROR 1 --- [nio-8080-exec-8] o.f.u.m.s.FlowableModelQueryService : Import failed for BigPicture.bpmn
org.flowable.bpmn.exceptions.XMLException: Error processing BPMN document
at org.flowable.bpmn.converter.BpmnXMLConverter.convertToBpmnModel(BpmnXMLConverter.java:448) ~[flowable-bpmn-converter-6.4.2.1.jar:6.4.2.1]
at org.flowable.ui.modeler.service.FlowableModelQueryService.importProcessModel(FlowableModelQueryService.java:179) ~[flowable-ui-modeler-logic-6.4.2.1.jar:6.4.2.1]
...
Caused by: java.lang.NullPointerException
at org.flowable.bpmn.converter.parser.ExtensionElementsParser.parse(ExtensionElementsParser.java:55) ~[flowable-bpmn-converter-6.4.2.1.jar:6.4.2.1]
at org.flowable.bpmn.converter.BpmnXMLConverter.convertToBpmnModel(BpmnXMLConverter.java:399) ~[flowable-bpmn-converter-6.4.2.1.jar:6.4.2.1]
Expected behavior The model should be imported and visualised. It works in e.g. https://bpmn.io online demo.
Code I will try to provide a simple test case for reproducing this bug if needed.
Additional context
Using flowable 6.4.2.1 (also tried 6.5.0-SNAPSHOT as of today).
Checked out source and ran the org.flowable.engine.test.bpmn.usertask.ImportExportTest
with my file.
The problem is that if no process is found in the XML (there is none defined), then in org.flowable.bpmn.converter.parser.ExtensionElementsParser:parse()
, the if/else block does not set the parentElement
(parentElement = activeProcess
will set null
), and the subsequent call parentElement.addExtensionElement(extensionElement);
will fail, resulting in a NPE.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (6 by maintainers)
Top GitHub Comments
Like Tim already explained very well the Flowable Modeler tool focuses on executable process models. So having a process model with multiple pools and one pool not being executable is not supported. The goal of our Modeler is to, in the end, run the process model on the Flowable BPMN engine.
A similar thing is the case for the message event definition without a message ref. For an executable process model the message ref is required, because that defines the type of message you are sending.
For the intermediate message throw event I already explained on the PR that you created that we don’t support this because we don’t support collaboration diagrams with message interaction. Instead, signal events can be used to communicate between related process models to provide a way to communicate events from one process model to the other.
Thanks @tijsrademakers and @tstephen for the thorough and patient explanations of all the factors at play here; quite a lot to digest since only now I finally have a real use case in a real project, previously only loosely followed the workflow topic out of interest.
I’d be very happy if the PR #2068 would be included in the near future, as I guess this could happen quite often when designing workflows with business experts and later moving to implementation without friction and the need for manual changes to the BPMN XML.