[rules-users] Parameterized Queries?

Robert Crawford crawford at kloognome.com
Wed Sep 5 13:39:45 EDT 2007


Does anyone know how to use parameterized queries? I'm trying to retrieve
ONLY the results for a single installation, with a query like this:

query "find errors for site"
    validationError: ValidationError(this.siteId == $1)
end

QueryResults results = session.getQueryResults("find errors for site", new
Object[] {siteId});

I get the error

"org.drools.RuntimeDroolsException: Exception executing predicate
org.drools.base.mvel.MVELPredicateExpression

Caused by: org.mvel.PropertyAccessException: unable to resolve property: $1"

I'm pretty sure I'm not writing the rule correctly in the DRL; does anyone
know the correct syntax? The manual isn't clear on this.

Thanks!




More information about the rules-users mailing list