kiegroup / kie-tooling-store

5 stars 5 forks source link

Editor cannot visualize imported BKM Nodes from another DMN file #51

Closed bouzasvas closed 3 years ago

bouzasvas commented 3 years ago

VS Code editor cannot visualize anything that is included from another DMN file although XML file (which is produced from Process Automation Manager) contains the corresponding tags.

Also Editor cannot Include DMN Models from another DMN files.

Finally, when a small change is performed in DRG all the corresponding included models are deleted.

karreiro commented 3 years ago

Hi @bouzasvas,

A DMN model created in the Process Automation Manager (Business Central) is almost identical to a Kogito VSCode extension model. The XML file is quite the same, as we've unified marshallers by the end of 2020.

When you include b.dmn inside an a.dmn, following the spec, we need to fetch b.dmn every time you open the a.dmn.

Thus, to open a.dmn on Kogito, you would need to put a.dmn and b.dmn in the same directory. This is the tricky part, in the Business Central, they don't need to live in the same directory (maybe that's the problem).

I hope this clue fixes the issue, but don't hesitate on sharing more details if it doesn't help :-)

Thank you for the feedback! 🚀

bouzasvas commented 3 years ago

Hello @karreiro ,

Thank you very much for your reply!

Following the above instructions did not solve the problem....

Here are the steps that I re-produced:

  1. Created a .dmn file with a single decision & an input element
  2. Created a .dmn file (in the same directory) with a single BKM Element
  3. Tried to Import the second .dmn (with the BKM Element) in the first .dmn file

The result is that under the included models dropdown the VS Code extension is unable to find any DMN Model available (although my .dmn file exists in the same directory!)

I am using the DMN Editor plugin v.0.9.0 along with VS Code version 1.55.1.

bouzasvas commented 3 years ago

Hello again,

After reviewing your changelog I noticed the issue KOGITO-3718 which have been resolved.

Included models work only if .dmn files are in the Project root directory. So I tested the above and it works.

Although we have organized our dmn files in directories and the above workaround does not seem to be really helpful for us.

Is there any way that we can override the above behavior?

Thanks, Bill

karreiro commented 3 years ago

Hello @bouzasvas,

Unfortunately, the models currently need to live in the same directory. This is something we want to improve in middle-term future (to find all models in a Java project).

However, currently the query for getting the resources lives here: https://github.com/kiegroup/kie-wb-common/blob/706a7afc194a0fac5f29135a6e5a72868b504e41/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-common/src/main/java/org/kie/workbench/common/dmn/webapp/kogito/common/client/included/DMNMarshallerImportsContentServiceKogitoImpl.java#L69

Maybe, a simple solution would be to extract the pattern/query above to a VSCode plugin property (@ederign is that possible? https://github.com/kiegroup/kogito-tooling/tree/master/packages/vscode-extension), and then we could consume that property into the class above. But right now, we would need to rely on community for this enhancement.

bouzasvas commented 3 years ago

Hello again @karreiro,

First of all I would like to thank you for your immediate replies and the useful information you provided me!

It would be really helpful if we could override the above behavior but I' ll check the source code lines that you indicated and I' ll try to figure it out.

For your information, Windows file system does not support Included Models even if they exist in the same directory! The only way I found to ovveride it was to put them in the root folder (/src) or use Unix based filesystem using WSL.

Thanks, Bill

karreiro commented 3 years ago

Thank you, @bouzasvas :-)

I hope we can improve that area soon. Also, I've just noticed that this PR (https://github.com/kiegroup/kogito-tooling/pull/477/files) was recently merged, thus I believe it fixes the issue related to Windows file systems :-)

bouzasvas commented 3 years ago

Thanks for responding @karreiro !

Keep up the good job! B.