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 15b - no-name imports #674

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

StrayAlien
Copy link
Contributor

@StrayAlien StrayAlien commented Aug 6, 2024

Hold onto your hats. Tests for the new "no-name" import feature of DMN 1.5b.

Import tests can be very confusing, so, I have broken these up into lots of small models with an associated test suite comprising of (generally) just one assertion.

Here is the new spec text:

Multiple imports with empty import names are allowed in the default namespace and their precedence is resolved according to their definition order. 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.

Some things to note:

  • "name collision" is not just any name - itemDefinitions/imports can share names with DRG elements. That has been exercised here.
  • I think this should also be "id collision" as ids should be unique within a model AFAIK. So, if an imported model has an id that conflicts with the importing model then it should also not be imported (IMO). I wanted to test this, but, in strictness, the spec does not mention it. I think we should test it ... somehow.
  • some test models have "dependency loops" in that a model may directly or indirectly import its own namespace. We can't really test for the loop, but, we can put it in tests as a sanity check for runtimes to make sure they don't fall over.
  • tests here assert stuff about direct imports as well as imports of imports.

Each test suite has some small notes in it describing the model structure and expectations.

Comments welcome.

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

Successfully merging this pull request may close these issues.

1 participant