question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BPMN20 XML import throws NullPointerException when no process is found

See original GitHub issue

Describe 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:closed
  • Created 4 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tijsrademakerscommented, Dec 18, 2019

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.

0reactions
grexecommented, Dec 19, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I get NullPointerException when using org.activiti ...
I've created a new bpmn file (bpmnWithoutDI2) with xml content : ... <process id="myProcess" name="My process" isExecutable="true"> ...
Read more >
How to Fix and Avoid NullPointerException in Java - Rollbar
NullPointerException in Java occurs when a variable is accessed which is not pointing to any object and refers to nothing or null.
Read more >
Fix list for the IBM Business Process Manager Version 8.5 ...
XML (NO SUCH FILE OR DIRECTORY) IN THE LOG FOR THE BPMUPDATESYSTEMAPP COMMAND. JR56801, TASK INDEXER FAILS WITH A NULLPOINTEREXCEPTION WHEN IT CAN'T...
Read more >
Java NullPointerException - Detect, Fix, and Best Practices
When we run the above program, it throws the following NullPointerException error message. Exception in thread "main" java.lang.
Read more >
Sitemap Settings import throws null pointer exception if ...
Sitemap Settings import throws null pointer exception if <settings> element is missing in the sitemapconfiguration.xml.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found