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

[PoC] Import decisions and BKMs from another DMN #222

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Conversation

saig0
Copy link
Member

@saig0 saig0 commented Jun 27, 2023

Description

This is a proof-of-concept (PoC) to see how we could import decisions and BKMs from another DMN file.

The general idea:

  • Store parsed decisions/BKMs in a repository.
  • Ignore imported decisions/BKMs during the parsing.
  • On evaluation, load the imported decisions/BKMs from the repository.

Open to-do's:

  • Move the loading of imported decisions/BKMs from the parser to the evaluation logic. The import is part of the evaluation.
  • Handle decisions/BKMs with namespaces natively (i.e. qualified names). Don't modify the name.
  • Evaluate imported decisions/BKMs differently by wrapping them into a FEEL context. The evaluation interprets the qualified name as a path expression.
  • Handle the case if an imported decision/BKM is not present. Don't throw exceptions.
  • Document the new public API.
  • Write more test cases to cover edge cases.
  • Fix the InvocationTest.scala. Out of scope for this PR because the test was not really correct before.

Related issues

related to #71

saig0 and others added 9 commits October 6, 2023 13:44
Replace whitespaces. Set decision id.
The invocation test fails now because all BKMs are parsed. Instead of parsing only BKMs that are referenced by a decision.

However, the behavior was also not fully correct before. If another decision referenced the BKM before then the invocation would invoke the BKM.
test: add TCK test case for imported decisions

Replace whitespaces. Replace decision id.

Modify the literal expressions of the decisions to return a different result.
Remove the resolve() function of the references. Instead, load imported models during the evaluation.

Handle missing models during the evaluation by returning a failure.

Refine and simplify the parsed types.
@saig0
Copy link
Member Author

saig0 commented Oct 6, 2023

I merged #225 into the branch and rebased it on main. 🏗️

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.

2 participants