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

Cannot model DMN model that imports other model with empty import name #1066

Closed
baldimir opened this issue Apr 5, 2024 · 2 comments · Fixed by apache/incubator-kie-drools#5830 or apache/incubator-kie-kogito-apps#2030
Assignees
Labels
area:dmn Related to DMN area:tools Issues affecting Apache KIE tooling projects type:bug Something is behaving unexpectedly

Comments

@baldimir
Copy link

baldimir commented Apr 5, 2024

When I model a decision (from scratch using the new DMN editor), that uses an imported BKM (also modelled in the editor), imported using the empty name (1.5 feature), it doesn't work with the runner (I am getting Unknown variable 'sayHello' errors - sayHello is the name of the imported BKM). I see the potential problem could be, how the editor adds the knowledgeRequirement:

<knowledgeRequirement id="_F4D15B4D-63AF-4956-9C39-96A1D2334146">
    <requiredKnowledge href="https://kie.org/dmn/_CDC1C967-6384-4BA9-989A-AC5385DDDFF7#_05703942-965D-4D2A-9579-E23A91DBB373" />
</knowledgeRequirement>

It is added with the namespace prefix (namespace before #). The namespace shouldn't be there, because the import with empty name imports into the default namespace of the model. This is from spec:

When the import name attribute is an empty string, the elements are imported in the default namespace of the
model. When a name collision occurs between an element in the default namespace and an imported element,
the imported element does not replace the one already in the default namespace while the elements without
name collision are imported.

So it should be used like this:

<knowledgeRequirement id="_F4D15B4D-63AF-4956-9C39-96A1D2334146">
    <requiredKnowledge href="#_05703942-965D-4D2A-9579-E23A91DBB373" />
</knowledgeRequirement>
@baldimir baldimir added type:bug Something is behaving unexpectedly area:dmn Related to DMN area:tools Issues affecting Apache KIE tooling projects labels Apr 5, 2024
@tiagobento tiagobento self-assigned this Apr 5, 2024
@tiagobento
Copy link

tiagobento commented Apr 5, 2024

As we discussed, there are two different interpretations here... one is related to FEEL namespaces, as referred to in here:

image

Namespace here means "the string before the .".

And the other is the namespace used in HREFs.

The way I understood it is that only the FEEL namespace should be affected by the name property of imports. It's odd to think that the name of the import would change the way we write HREFs.

Anyway, pending confirmation from the DMN experts. Thanks @baldimir for raising this!

@tiagobento
Copy link

Found something that may help clarify it in "12.3.2 References within the DMN XSD"

image

Source: https://www.omg.org/spec/DMN/1.5/Beta1/PDF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dmn Related to DMN area:tools Issues affecting Apache KIE tooling projects type:bug Something is behaving unexpectedly
Projects
Archived in project
3 participants