Open piacenti opened 4 months ago
Can you please provide a complete reproducer for this issue? It seems that we already have at least one test demonstrating how this works.
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"
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: https://github.com/apache/incubator-kie-drools/pull/6066
I also filed an issue to support the feature: https://github.com/apache/incubator-kie-drools/issues/6065
I hope it clarifies the current situation.
If I try a simple
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 OOPathIt seems that this functionality only works with legacy non OOPath approach
Expected behavior: replace
with
/a/b/c/d/object[type == "ABC"]