[rules-users] Parameterized Queries?
Edson Tirelli
tirelli at post.com
Wed Sep 5 14:19:14 EDT 2007
I think Mark just updated documentation for that and it will be included
in 4.0.2.
Meanwhile:
query "find errors for site"( int $param1, String $param2, ...)
validationError: ValidationError(this.siteId == $param1)
end
Parameter type is optional, and you can have as many parameters as you
need.
[]s
Edson
2007/9/5, Robert Crawford <crawford at kloognome.com>:
>
> 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!
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070905/94f5f4e6/attachment.html
More information about the rules-users
mailing list