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
157 stars 31 forks source link

.bpmn Suffixes support editing rather than .bpmn20.xml #186

Open DreamPWJ opened 4 years ago

DreamPWJ commented 4 years ago

You need to change the suffix to XML every time you edit it

DreamPWJ commented 4 years ago

At the same time, there are errors in THE XML edit directly does not display also prompt an error Like sequenceFlow add

${pass2=="N"}

image

valb3r commented 4 years ago

You need to change the suffix to XML every time you edit it

This plugin is for Flowable-BPMN engine and not for all kinds of BPMN systems. Unfortunately, each BPMN engine tends to have its own BPMN dialect (like file conform to the specification in general, but there are extra attributes that are crucial for correct display). This is why files are required to have *.bpmn20.xml pattern because it is default Flowable extension.

valb3r commented 4 years ago

At the same time, there are errors in THE XML edit directly does not display also prompt an error Like sequenceFlow add ${pass2=="N"}

Can you please add the line you are adding?

DreamPWJ commented 4 years ago
                '<conditionExpression xsi:type="tFormalExpression">${pass}</conditionExpression>'
valb3r commented 4 years ago

Maybe it is better if you share entire malfunctioning BPMN diagram (that you have edited manually), as this entry:

    <sequenceFlow id="sid-58467e25-160a-4c39-aea6-13578fbca47b" sourceRef="sid-b1e173b7-a39b-4c10-b7d0-2c72daaf058f" targetRef="collapsed-subprocess-id">
      <conditionExpression xsi:type="tFormalExpression">${pass == "N"}</conditionExpression>
    </sequenceFlow>

works OK with default namespaces. Also if there is an error opening file - red circle with "!" will appear in the bottom-right corner of IntelliJ. You can click on it to see the stacktrace

DreamPWJ commented 4 years ago

Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[25,68] Message: http://www.w3.org/TR/1999/REC-xml-names-19990114#AttributePrefixUnbound?conditionExpression&xsi:type&xsi

DreamPWJ commented 4 years ago

It works because the definition is missing

DreamPWJ commented 4 years ago

I found this today Camunda Modeler,It looks good

valb3r commented 4 years ago

Yes, it is good, but it is for Camunda BPMN dialect, the same way like this plugin is for Flowable BPMN dialect

DreamPWJ commented 4 years ago

Do I see that dialect matters?

valb3r commented 4 years ago

If you try to use BPMN file created for Flowable inside i.e. Camunda BPMN engine (workflow engine itself, real application) - you will see that it won't work as they use different XML-namespaces to describe how i.e. serviceTask should do its job. I.e. Camunda will complain that serviceTask is missing mandatory attribute

valb3r commented 4 years ago

i.e. serviceTask for Camunda:

<serviceTask id="beanService"
             name="My Bean Service Task"
             camunda:delegateExpression="${myDelegateBean}" />

serviceTask for Flowable

<serviceTask id="notifyUserWithRedirect" 
              name="Notify user with redirect url for challenge. Suspends to wait"
              flowable:async="true" 
              flowable:delegateExpression="${xs2aDoRedirectToAspspForScaChallenge}" 
              flowable:triggerable="true"/>

Notice many extra fields and completely different namespaces

DreamPWJ commented 4 years ago

I see it's better to meet the standards

DreamPWJ commented 4 years ago

I hope our plug-in can be improved as soon as possible

valb3r commented 4 years ago

Key point is - there is BPMN standard, but the standard is rather an interface. Each BPMN engine (Flowable, Camunda, jBPMN) implements this interface, but the details are very different. For example: flowable:triggerable="true" makes service task triggerable in Flowable, but there is no such feature in Camunda. Only Flowable has that.

This plugin aims to implement an editor for the Flowable-BPMN engine and not for all others (at least at this moment, in future it may support Camunda, but it is not near future). The primary goal of the existence of this plugin is to support Open Banking Gateway - our business project, this is why we use mostly Flowable BPMN implementation

DreamPWJ commented 4 years ago

Thank you very much. This is going to be a great project