[
https://issues.jboss.org/browse/DROOLS-4750?page=com.atlassian.jira.plugi...
]
Mario Fusco resolved DROOLS-4750.
---------------------------------
Resolution: Explained
What the knowledge builder does at some point is invoking this
{code}
new EvaluatorRegistry(this.getClass().getClassLoader());
{code}
which has the side-effect of registering the custom operators like 'str' into the
parser. If you add that line as first statement of your first test you will see that it
will also succeed. Note however that the DRLParser is an internal class that is not part
of our public API and not intended for direct access by our end-users. For this reason I
don't think that we should change it in any way to make it work also without a
knowledge builder.
DrlParser fails to parse str[endsWith] operator
-----------------------------------------------
Key: DROOLS-4750
URL:
https://issues.jboss.org/browse/DROOLS-4750
Project: Drools
Issue Type: Bug
Reporter: Alberto Fanjul Alonso
Assignee: Mario Fusco
Priority: Major
Attachments: reproducer.zip
In documentation
https://docs.jboss.org/drools/release/7.23.0.Final/drools-docs/html_singl...
operator str[endsWith] is supposed to be supported, it it is not working.
Fails with:
{code:java}
java.lang.Exception: Rule contains errors![[5,19]: [ERR 102] Line 5:19 mismatched input
'str' in rule "pnr first name end with"]
at
com.mdw.bzr.drools_reproducer.StrWithFailOnFirstCompilationErrorReproducerTest.parse(StrWithFailOnFirstCompilationErrorReproducerTest.java:58)
at
com.mdw.bzr.drools_reproducer.StrWithFailOnFirstCompilationErrorReproducerTest._03_parseStrWith(StrWithFailOnFirstCompilationErrorReproducerTest.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
{code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)