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

DSL Constraints Don't Work With OOPath #5961

Open
piacenti opened this issue May 17, 2024 · 3 comments
Open

DSL Constraints Don't Work With OOPath #5961

piacenti opened this issue May 17, 2024 · 3 comments

Comments

@piacenti
Copy link

piacenti commented May 17, 2024

If I try a simple

[when]with an object where=/a/b/c/d/object
[when]- type is "{type}"=type == "{type}"

I get this error
No pattern was found to add the constraint to: - type is "ABC"
it also doesn't matter if I add [] to the end of the OOPath

It seems that this functionality only works with legacy non OOPath approach

Expected behavior:
replace

with an object where
   - type is "ABC"

with
/a/b/c/d/object[type == "ABC"]

@mariofusco
Copy link
Contributor

Can you please provide a complete reproducer for this issue? It seems that we already have at least one test demonstrating how this works.

@piacenti
Copy link
Author

piacenti commented May 24, 2024

This is a problem specific when using the constrained fact functionality where the DSL line starts with a dash and is suppose to append the DSL to the preceding pattern condition. As shown in the documentation here it works with the pattern Cheese() rather than /cheese[]. Also I don't see any tests for the DSL constraint functionality. This would be helpful when going through nested properties like /cheese/flavor[] and have some DSL constraint like [when]- is sharp=type=="sharp"

@tkobayas
Copy link
Contributor

tkobayas commented Sep 4, 2024

Hi @piacenti ,

I noticed that you meant OOPath for RuleUnit. It's not supported yet. What @mariofusco mentioned was a test for OOPath in traditional syntax. I filed a document PR to remove the confusing section "Domain Specific Languages" from "Rule Language Reference" chapter: #6066

I also filed an issue to support the feature: #6065

I hope it clarifies the current situation.

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

No branches or pull requests

3 participants