]
IVAN ZILOTTI updated DROOLS-4604:
---------------------------------
Priority: Blocker (was: Major)
Query code generation neglects query parameter(s)
-------------------------------------------------
Key: DROOLS-4604
URL:
https://issues.jboss.org/browse/DROOLS-4604
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 7.27.0.Final
Reporter: IVAN ZILOTTI
Assignee: Mario Fusco
Priority: Blocker
The Drools _query_ code generated by the test method below is not including the query
parameter ({{String eventId}}) specified via {{PackageDescrBuilder}}.
Note that parameters to Drools _functions_ constructed through the same process are
correctly included. See _org.drools.compiler.lang.api.DescrBuilderTest#testFunctions_.
h3. Generated code
{code:java}
package org.test.rules
import org.test.event.TemporalEvent
query "getTemporalEventById"
TemporalEvent( id == eventId ) from entry-point "TemporalEventStream"
end
{code}
h3. Test
{code:java}
@Test
public void testFluentQuery() {
PackageDescrBuilder packBuilder =
DescrFactory.newPackage()
.name("org.test.rules")
.newImport()
.target("org.test.event.TemporalEvent")
.end()
.newQuery()
.name("getTemporalEventById")
.parameter("String", "eventId")
.lhs()
.pattern( "TemporalEvent")
.constraint("id == eventId")
.from()
.entryPoint("EventStream")
.end()
.end()
.end()
.end();
String query = new DrlDumper().dump(packBuilder.getDescr());
System.out.println(query);
}
{code}