Bug 742893

Summary: Parametrized queries don't work in DSL
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Tomas Schlosser <tschloss>
Component: BRE (Expert, Fusion)Assignee: Mario Fusco <mfusco>
Status: VERIFIED --- QA Contact: Lukáš Petrovický <lpetrovi>
Severity: medium Docs Contact:
Priority: unspecified    
Version: BRMS 5.2.0.GACC: lpetrovi, mproctor
Target Milestone: ER6   
Target Release: BRMS 5.3.0.GA   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
When expanding a rule file that contains a definition of a query with parameters the knowledge builder returns the exception, 'Unable to expand'. This issue has been resolved by changing the regular expression in the DSL expander to recognize parametrized queries.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Tomas Schlosser 2011-10-03 09:57:06 UTC
Description of problem:
When expanding rule file containing definition of query with parameters I get from knowledge builder 'Unable to expand: (Person p)'.

Version-Release number of selected component (if applicable):
5.2.0.ER5

How reproducible:
every time

Steps to Reproduce:
1. add included dsl and dslr files to KnowledegBuilder
2. check that KnowledgeBuilder.getErrors() returns reported problem
  
Actual results:
Unable to expand: (Person p)

Expected results:
Expanded DSL.

Additional info:
dslr file:
package org.jboss.qa.drools.features

import org.jboss.qa.drools.domain.Person

query "isMature"(Person p)
	There is a person
		- age is greater than 18
		- equals p
end

dsl file:
[when]There is a person=Person()
[when]- {field:\w*} {operator} {value:\d*}={field} {operator} {value}
[when]- equals {variable}=this := {variable}
[when]is greater than=>

Comment 2 JBoss JIRA Server 2012-04-04 16:10:15 UTC
Mario Fusco <mario.fusco> updated the status of jira JBRULES-3447 to Resolved

Comment 3 Ryan Zhang 2012-04-23 07:40:29 UTC
Update status to ON_QA. Please verify them against ER6.

Comment 4 lcarlon 2012-06-01 03:52:05 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When expanding a rule file that contains a definition of a query with parameters the knowledge builder returns the exception, 'Unable to expand'.

Comment 5 lcarlon 2012-06-01 03:53:55 UTC
Hi Mario,

For the release notes could you let me know how this issue was resolved. We need to let customers know about any changes in the code that could affect their systems.

Thanks
Lee

Comment 6 Mario Fusco 2012-06-01 07:15:14 UTC
Hi Lee,

to fix this issue I just changed the regular expression in the DSL expander to also recognize the case of parametrized queries.

This is the commit that fixed that issue:

https://github.com/droolsjbpm/drools/commit/ef3892bacd8fbf0742b0a608598b6108d0954db6

Mario

Comment 7 lcarlon 2012-06-03 21:57:12 UTC
Thanks Mario!

Comment 8 lcarlon 2012-06-03 22:02:04 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-When expanding a rule file that contains a definition of a query with parameters the knowledge builder returns the exception, 'Unable to expand'.+When expanding a rule file that contains a definition of a query with parameters the knowledge builder returns the exception, 'Unable to expand'. This issue has been resolved by changing the regular expression in the DSL expander to recognize parametrized queries.