valb3r / flowable-bpmn-intellij-plugin

Flowable, Activiti, Camunda BPMN engines process editor plugin for IntelliJ. Pure Kotlin (and some Java)
https://plugins.jetbrains.com/plugin/14318-flowable-bpmn-visualizer
MIT License
155 stars 31 forks source link

Support diagram generation for valid processes with no diagram: MissingKotlinParameterException Plugin Crash when you open BPMN20.xml file #203

Open chex123 opened 3 years ago

chex123 commented 3 years ago

Is your feature request related to a problem? Please describe. I have valid Flowable processes in bpmn20.xml files that have no defined diagram. I would like to be able to load them in the visual editor. Currently I just get a blank display and an NPE as follows.

kotlin.KotlinNullPointerException at com.valb3r.bpmn.intellij.plugin.flowable.parser.FlowableParser.toProcessObject(FlowableParser.kt:644) at com.valb3r.bpmn.intellij.plugin.flowable.parser.FlowableParser.parse(FlowableParser.kt:157) at com.valb3r.bpmn.intellij.plugin.core.CanvasBuilder.build(CanvasBuilder.kt:54) at com.valb3r.bpmn.intellij.plugin.BpmnPluginToolWindow.run(BpmnPluginToolWindow.kt:70)

Describe the solution you'd like If there is no defined diagram a diagram should be generated for the existing elements. It would be the user's job to lay this out nicely.

At a minimum it should not throw the NPE and should be usable to manually add the existing elements to a blank diagram.

Describe alternatives you've considered Because my processes already exist with no diagram, this is pretty much the only route to using this tool. Other tools appear to the same issue.

Describe the bug This plugin crashes with the stack-trace below when you try to open the sample bpmn20.xml file: com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class com.valb3r.bpmn.intellij.plugin.flowable.parser.nodes.process.SequenceFlow] value failed for JSON property id due to missing (therefore NULL) value for creator parameter id which is a non-nullable type at [Source: (StringReader); line: 8, column: 83] (through reference chain: com.valb3r.bpmn.intellij.plugin.flowable.parser.nodes.BpmnFile["process"]->java.util.ArrayList[0]->com.valb3r.bpmn.intellij.plugin.flowable.parser.nodes.ProcessNode["sequenceFlow"]->java.util.ArrayList[0]->com.valb3r.bpmn.intellij.plugin.flowable.parser.nodes.process.SequenceFlow["id"]) at com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator.createFromObjectWith(KotlinValueInstantiator.kt:112) at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:198) at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:488) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1287) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:326) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:530) at com.fasterxml.jackson.databind.deser.impl.MergingSettableBeanProperty.deserializeAndSet(MergingSettableBeanProperty.java:78) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.dataformat.xml.deser.WrapperHandlingDeserializer.deserialize(WrapperHandlingDeserializer.java:114) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:530) at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:528) at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:417) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1287) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:326) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159) at com.fasterxml.jackson.dataformat.xml.deser.WrapperHandlingDeserializer.deserialize(WrapperHandlingDeserializer.java:114) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4202) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3205) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3188) at com.valb3r.bpmn.intellij.plugin.flowable.parser.FlowableParser.parse(FlowableParser.kt:697) at com.valb3r.bpmn.intellij.plugin.core.CanvasBuilder.build(CanvasBuilder.kt:54) at com.valb3r.bpmn.intellij.plugin.BpmnPluginToolWindow.run(BpmnPluginToolWindow.kt:70) at com.valb3r.bpmn.intellij.plugin.flowable.actions.ViewFlowableBpmnDiagramAction$actionPerformed$1.run(ViewFlowableBpmnDiagramAction.kt:25) at com.intellij.openapi.wm.impl.ToolWindowManagerImpl$activateToolWindow$1.run(ToolWindowManagerImpl.kt:606) at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802) at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:322) at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84) at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:132) at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47) at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:188) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:971) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:841) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:452) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:744) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:451) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:499) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

To Reproduce Steps to reproduce the behavior:

  1. Right click your bpmn20.xml file
  2. Click on 'view bpmn (flowable) diagram'
  3. Check the bottom right hand corner of intelliJ 'IDE intenal error icon'
  4. See error

BPMN definition

Expected behavior The diagram editor for the bpmn20.xml file should open

Screenshots Screen Shot 2020-11-20 at 1 17 18 PM

IntelliJ version (please complete the following information):

Additional context None

valb3r commented 3 years ago

@chex123 Can you please provide BPMN definition, or is it same as https://github.com/valb3r/flowable-bpmn-intellij-plugin/issues/203

chex123 commented 3 years ago

@chex123 Can you please provide BPMN definition, or is it same as #203

<?xml version="1.0" encoding="UTF-8"?>

chex123 commented 3 years ago

I think the issue might be that I do not have any DI (Diagram Tags) in the xml as you can see above. How do I automatically generate DI tags from an xml without any DI tags (xml with only bpmn process tags)

valb3r commented 3 years ago

The plugin relies heavily on the and DI tags since it closely follows Flowable-modeler... It is an element auto-layout problem, that can be solved with PlantUML or GrapViz to some extent. The auto-generated result will far away from ideal, but I think I can try to add diagram autogeneration to the plugin for such cases

chex123 commented 3 years ago

Good day Thanks for your reply and update. Yes a check in the plugin to auto generate DI tags if they are not available in the xml file would be super helpful

Please kindly let me know if its something you would be doing soon

Regards Chex

On Wed, Nov 25, 2020, 5:30 AM Valentyn Berezin notifications@github.com wrote:

The plugin relies heavily on the and DI tags since it closely follows Flowable-modeler... It is an element auto-layout problem, that can be solved with PlantUML or GrapViz to some extent. The auto-generated result will far away from ideal, but I think I can try to add diagram autogeneration to the plugin for such cases

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/valb3r/flowable-bpmn-intellij-plugin/issues/203#issuecomment-733619393, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2TIOTNWTE4OORBD6OQCHTSRTMFZANCNFSM4T5JN2XQ .

valb3r commented 3 years ago

@chex123 No I don't think it will come soon, currently, the are more important features are on the plate, maybe in 3-4 months from now

chex123 commented 3 years ago

Thank you for your response

In the mean time what way (or software) do you recommend I use to generate the DI tags? Am still new to this technology

I appreciate your help Regards Chex

On Fri, Nov 27, 2020, 6:41 AM Valentyn Berezin notifications@github.com wrote:

@chex123 https://github.com/chex123 No I don't think it will come soon, currently, the are more important features are on the plate, maybe in 3-4 months from now

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/valb3r/flowable-bpmn-intellij-plugin/issues/203#issuecomment-734794411, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2TIOXRGGYDUD7ZQ2B3VPTSR6GAHANCNFSM4T5JN2XQ .

valb3r commented 3 years ago
  1. You could try https://github.com/bpmn-io/bpmn-auto-layout
  2. Or maybe this https://github.com/MarvinLudwig/bpmn_layouter in combination with https://github.com/camunda/camunda-modeler
  3. But personally I would prefer creating diagram using some visual editor (like this plugin) as shown here: https://www.youtube.com/watch?v=pBfAGdp169s&feature=youtu.be or using bpmn.io online editor
chex123 commented 3 years ago

Thanks a lot. Will try it out and let you know

Kind regards Chex

On Fri, Nov 27, 2020, 7:43 AM Valentyn Berezin notifications@github.com wrote:

  1. You could try https://github.com/bpmn-io/bpmn-auto-layout
  2. Or maybe this https://github.com/MarvinLudwig/bpmn_layouter in combination with https://github.com/camunda/camunda-modeler
  3. But personally I would prefer creating diagram using some visual editor (like this plugin) as shown here: https://www.youtube.com/watch?v=pBfAGdp169s&feature=youtu.be or using bpmn.io online editor

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/valb3r/flowable-bpmn-intellij-plugin/issues/203#issuecomment-734817790, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2TIOSALAHA6KOJOBOEFT3SR6NHFANCNFSM4T5JN2XQ .