Hide Forgot
Description of problem: Trying the example in Drools Expert user guide does not work. If you use only one triplet, it works as described in documentation (the string is compared to a and if they are equal it returns b, otherwise it returns c). However if more there is another triplet in c, it throws compilation error. Version-Release number of selected component (if applicable): BRMS 6.0.0.ER3 How reproducible: # definitions for conditions [when][]There is an? {entity}=${entity!lc}: {entity!ucfirst}() [when][]- with an? {attr} greater than {amount}={attr} <= {amount!num} [when][]- with a {what} {attr}={attr} {what!positive?>0/negative?%lt;0/zero?==0/ERROR} Steps to Reproduce: 1. create a new DSL including lines mentioned above 2. compile a kie base Actual results: Message [id=1, level=ERROR, path=null, line=5, column=0 text=DSL parser error] Message [id=2, level=ERROR, path=null, line=5, column=0 text=DSL parser error] Expected results: compilation goes without error, expressions are expanded correctly Additional info:
I have just narrowed the problem. It appears that the exception does not depend on how many nested transformations are used, but rather by use of '=' sign. No matter on which position it appears (or if there are actually more than one transformations). These expressions work: [when]- with a {what} {attr}={attr} {what!positive?>0/EROOR} [when]- with a {what} {attr}={attr} {what!positive?>0/negative?<0/EROOR} These do not: [when]- with a {what} {attr}={attr} {what!zero?==0/!=0} [when]- with a {what} {attr}={attr} {what!positive?>0/==0} [when]- with a {what} {attr}={attr} {what!positive?>0/negative?<0/zero?==0/EROOR} I'll also include the dsl and dslr used to test this.
Created attachment 805894 [details] Dslr used for testing the bug
Created attachment 805895 [details] Dsl used for testing the bug Contains valid DSL expression. To reproduce the bug, simply change the fifth line to whatever is in the bug report.
I added a test case reproducing the problem https://github.com/droolsjbpm/drools/commit/f080cc297
Fixed. (master): https://github.com/droolsjbpm/drools/commit/64501a22e38c14c3e525df0dc2b517cc5de0448d (6.0.x): https://github.com/droolsjbpm/drools/commit/2d1d9769050133a8c68220a0022ca2dfa5c6a092
Verified in Brms 6.0.1.ER1