Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Kogito - VSCode] Validation of DMN file: How to Enforce Data Type Consistency in Input Values? #2906

Open
kanetran opened this issue Feb 13, 2025 · 6 comments
Labels

Comments

@kanetran
Copy link

kanetran commented Feb 13, 2025

In my DMN file in VSCode, I have defined specific data types for each object.

For example, volume is defined as a number. However, I noticed that it is still possible to enter values of different types (e.g., strings or other unexpected inputs).

Image

I need to validate that the input values strictly match the defined data type. The validation should occur in one of the following cases:

  • When a user enters the value in VSCode.
  • When the rule is saved in VSCode.

I using:

  • DMN version version 1.2.
  • Java version 17.
  • Kogito API version 10.0.0

I am looking for ways to enforce this validation effectively. Is there a built-in way in DMN to enforce type consistency?

Any guidance or best practices would be greatly appreciated!

@jomarko
Copy link
Contributor

jomarko commented Feb 13, 2025

This should be doable using our https://marketplace.visualstudio.com/items?itemName=kie-group.extended-services-vscode-extension . However, we need to recheck this scenario as there were recently updates to this extension, that are not publicly available yet.

@kanetran
Copy link
Author

I see, but in some cases, it seems that the validation does not catch errors correctly. For instance, I have a volume field of type number, but when I write a rule with a text value like "abc", it does not detect the error.

It would be great if this scenario could be rechecked to ensure proper validation. Looking forward to any updates on this!

Image

@jomarko
Copy link
Contributor

jomarko commented Feb 13, 2025

I understand, I am using the extension built locally from main branch. I was able to see an error about using string instead of number:

Image

@kanetran
Copy link
Author

Yes, I see it work for DMN 1.5 and extended-services-vscode-extension 10.0
Image
For any reason like test scenario,.. I can not upgrade to DMN 1.5.

In my previous example, I was using DMN 1.2 with Kogito Extension 10.0 (extended-services-vscode-extension 10.0).
Image

As far as I can see, the extended-services-vscode-extension version 10.0 only works with DMN 1.5, while the Kogito Bundle 0.32.0 is for DMN 1.2. However, I couldn't find the extended-services-vscode-extension when I downgraded to version 0.32.0.

@jomarko
Copy link
Contributor

jomarko commented Feb 14, 2025

Well, I am sorry for this situation with incompatible versions. We are approaching merge of the new scesim-editor, that will be compatible with DMN 1.5

#2887

@kanetran
Copy link
Author

Thank you for your support! I'm also looking forward to DMN 1.5 being able to run test scenarios as soon as possible.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants