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

71 from poc - dynamic import loading #225

Merged
merged 6 commits into from
Oct 6, 2023
Merged

Conversation

tracy-hires
Copy link
Contributor

Description

This addresses the following todos referenced in #222:

  • 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

closes #

dependabot bot and others added 6 commits July 6, 2023 00:18
Bumps [feel-engine](https://github.com/camunda/feel-scala) from 1.16.0 to 1.16.1.
- [Release notes](https://github.com/camunda/feel-scala/releases)
- [Commits](camunda/feel-scala@1.16.0...1.16.1)

---
updated-dependencies:
- dependency-name: org.camunda.feel:feel-engine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…nda.feel-feel-engine-1.16.1

chore(deps): bump feel-engine from 1.16.0 to 1.16.1
@tracy-hires tracy-hires requested a review from saig0 as a code owner August 28, 2023 19:02
@saig0
Copy link
Member

saig0 commented Sep 5, 2023

@tracy-hires awesome. Thank you for contributing. 🎉

Currently, I'm very busy shipping important features in the FEEL engine. I don't have time to look at your PR immediately. I'll try to find some time in the next weeks. 🤞

@saig0
Copy link
Member

saig0 commented Sep 28, 2023

🚋 I'll review the PR next week.

Copy link
Member

@saig0 saig0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tracy-hires I checked your changes closely. And, I like them, especially the introduction of a reference type. 👍

I see a few points that could be improved. See my comments for details.

I'll merge your PR as it is and add my own changes on top. This way, we can shorten the review cycle and move faster. 🚀

Thank you again for your contribution and your patience. 🎉

Comment on lines +96 to +99
override def resolve(): ParsedDecision = repository.getDecision(namespace, id) match {
case Right(found) => found
case Left(failure) => ParsedDecisionFailure(id, namespace, ExpressionFailure(failure.message)).resolve()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ The parsed objects (i.e. DTOs) should not contain the logic to load an imported decision/BKM.

Instead, we should keep the DTOs clean and simple, and move the loading into the evaluation logic.

.map(bkm => {
ParsedInvocation(bindings, bkm)
.map(bkmRef => {
ParsedInvocation(bindings, bkmRef.resolve())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ The invocation doesn't work for imported BKMs.

If the invocation requires an imported BKM and the BKM is not parsed yet, then the resolve() will throw an exception.

Instead of resolving the BKM during the parsing, we should load the BKM during the evaluation. The same way as we do for required decisions/BKMs.

@saig0 saig0 merged commit b171f49 into camunda:71-poc Oct 6, 2023
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.

3 participants