Bug 1013960

Summary: DSL transformation function a?b/c can't use = sign in replacements
Product: [Retired] JBoss BRMS Platform 6 Reporter: Tomas Schlosser <tschloss>
Component: BREAssignee: Edson Tirelli <etirelli>
Status: CLOSED CURRENTRELEASE QA Contact: Tomas Schlosser <tschloss>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: etirelli, mfusco, mwinkler
Target Milestone: ER1   
Target Release: 6.0.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 19:57:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Dslr used for testing the bug
none
Dsl used for testing the bug none

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