Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[dmn-editor] Specification of function types is not supported in the 'Data types' tab #2872

Open
opatrascoiu opened this issue Jan 24, 2025 · 5 comments
Labels

Comments

@opatrascoiu
Copy link

opatrascoiu commented Jan 24, 2025

According to the DMN 1.3 specification, function types can be described via functionItems (see https://github.com/omg-dmn-taskforce/omg-dmn-spec/blob/master/xsd/DMN16.xsd).

Without this feature is difficult to model invocables (BKMs and Decision Services) as the typeRef of the variable tag has to point to such a type.

Example: https://github.com/dmn-tck/tck/blob/master/TestCases/compliance-level-3/0082-feel-coercion/0082-feel-coercion.dmn#L455

Duplicates: apache/incubator-kie-issues#1756

@tiagobento
Copy link
Contributor

True, we haven't ever had support for this feature and it is indeed a gap.

@tiagobento
Copy link
Contributor

@opatrascoiu Currently if you define the "typeRef" of a BKM or a Decision Service, you're essentially defining the return of that invocable. Not ideal, but that's how this has been for a while now...

@jomarko
Copy link
Contributor

jomarko commented Jan 27, 2025

@opatrascoiu yes, we already track this issue apache/incubator-kie-issues#1756

@opatrascoiu
Copy link
Author

@tiagobento Currently, the type specified by the user populates the typeRefs of the variable and encapsulatedLogic tags.

This is incorrect. This issue was present in the TCK suite as well. It was addressed here dmn-tck/tck#423

The modelling of BKMs, without using the function type, can be done as follows:

  • typeRef of variable and encapsulatedLogic is undefined
  • typeRef of the parameter is defined (e.g. boolean)
  • typeRef of the expression that represents the body of the BKM is set ()
  • the type of the BKM is inferred from the above parts

An example is here https://github.com/dmn-tck/tck/blob/master/TestCases/compliance-level-3/0087-chapter-11-example/0087-chapter-11-example.dmn#L343

Currently, the DMN editor does not allow the specification of the type of the body, but it allows the specification of the types of the parameters.

To comply with the standard we need to have at least one feature:

  • support function types or
  • be able to specify the typeRef of the body of the BKM

@opatrascoiu
Copy link
Author

@jomarko Thank you for the prompt reply. Is there an estimated timeline?

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

No branches or pull requests

3 participants