Bug 1013960 - DSL transformation function a?b/c can't use = sign in replacements
Summary: DSL transformation function a?b/c can't use = sign in replacements
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ER1
: 6.0.1
Assignee: Edson Tirelli
QA Contact: Tomas Schlosser
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-01 07:20 UTC by Tomas Schlosser
Modified: 2014-08-06 19:57 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 19:57:49 UTC
Type: Bug


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

Description Tomas Schlosser 2013-10-01 07:20:24 UTC
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 12:14:00 UTC
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 12:23:24 UTC
Created attachment 805894 [details]
Dslr used for testing the bug

Comment 3 Tomas Schlosser 2013-10-01 12:24:39 UTC
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 07:24:21 UTC
I added a test case reproducing the problem https://github.com/droolsjbpm/drools/commit/f080cc297

Comment 9 Tomas Schlosser 2014-02-24 10:34:20 UTC
Verified in Brms 6.0.1.ER1


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