java.util.EmptyStackException at ProcessDefinitionUtil.getBpmnModel

Hi Team,

During migration to Flowable v6 from Activiti v5 I have faced the following problem:

java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:102)
at org.flowable.engine.impl.context.Context.getFlowable5CompatibilityHandler(Context.java:176)
at org.flowable.engine.impl.util.Flowable5Util.getFlowable5CompatibilityHandler(Flowable5Util.java:124)
at org.flowable.engine.impl.util.ProcessDefinitionUtil.getBpmnModel(ProcessDefinitionUtil.java:72)

Here is the link to the simple project with BpmnModelTest which reproduces the problem.
https://drive.google.com/open?id=0B60Jt3r-RIpTQUZkSzlMd2Qtbm8

It happens on actual 6.1.0-SNAPSHOT version; if I use 6.0.1 release it works.
Could you please have a look?

Thank you
Alexander

Hi Alexander.

Similar issue is: How can get the id of the next activity with the id of current activity?
6.1.0-SNAPSHOT requires to call getBpmnModel method inside a command.

Regards
Martin

Thanks Martin, it solved my problem.

Hi Alexander,

On the RepositoryService there’s also a getBpmnModel available. You should use that method instead of using the ProcessDefinitionUtil class, because that’s an internal class that can only be used inside a Command.

Best regards,

Tijs

Hi Tijs, thanks it works fine in this way.