Bug 742893 - Parametrized queries don't work in DSL
Summary: Parametrized queries don't work in DSL
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: BRMS 5.2.0.GA
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ER6
: BRMS 5.3.0.GA
Assignee: Mario Fusco
QA Contact: Lukáš Petrovický
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-03 09:57 UTC by Tomas Schlosser
Modified: 2022-05-31 22:28 UTC (History)
2 users (show)

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.
Clone Of:
Environment:
Last Closed:
Type: ---


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBRULES-3447 0 Major Resolved Parametrized queries don't work in DSL 2017-05-16 10:33:12 UTC

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.


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