Bug 1013960 - DSL transformation function a?b/c can't use = sign in replacements
DSL transformation function a?b/c can't use = sign in replacements
Status: CLOSED CURRENTRELEASE
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
unspecified
Unspecified Unspecified
medium Severity medium
: ER1
: 6.0.1
Assigned To: Edson Tirelli
Tomas Schlosser
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-01 03:20 EDT by Tomas Schlosser
Modified: 2014-08-06 15:57 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-06 15:57:49 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Dslr used for testing the bug (288 bytes, text/plain)
2013-10-01 08:23 EDT, Tomas Schlosser
no flags Details
Dsl used for testing the bug (257 bytes, text/plain)
2013-10-01 08:24 EDT, Tomas Schlosser
no flags Details

  None (edit)
Description Tomas Schlosser 2013-10-01 03:20:24 EDT
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:
Comment 1 Tomas Schlosser 2013-10-01 08:14:00 EDT
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.
Comment 2 Tomas Schlosser 2013-10-01 08:23:24 EDT
Created attachment 805894 [details]
Dslr used for testing the bug
Comment 3 Tomas Schlosser 2013-10-01 08:24:39 EDT
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.
Comment 7 Mario Fusco 2013-10-11 03:24:21 EDT
I added a test case reproducing the problem https://github.com/droolsjbpm/drools/commit/f080cc297
Comment 9 Tomas Schlosser 2014-02-24 05:34:20 EST
Verified in Brms 6.0.1.ER1

Note You need to log in before you can comment on or make changes to this bug.