[rules-dev] query examples

Wolfgang Laun wolfgang.laun at gmail.com
Thu Oct 28 13:16:55 EDT 2010


Please do not post newbie questions on the developers' list, use
rules-users at lists.jboss.org.

Rules have mandatory keywords such as "rule", "when", "then", "end". Read
the manual, please.

-W


On 28 October 2010 18:46, DDUGGAN <dennis at esptechnologies.com> wrote:

>
> Can someone point me in the direction of examples using queries??  I have a
> simple query and rule that I cannot get operational.
>
>
>
> query "IKnow"
>    oRecord : MyRecord( status == "IKnow" )
> end
>
> rule "Print My Records"
>    no-loop true
>    dialect "java"
>    QueryResults $Results = ksession.getQueryResults( "IKnow" );         **
>    System.out.println( "We have " + results.size( ) + " Records" );
>
>    for ( QueryResultsRow row : results )
> **
>    {
>        MyRecord $oRecord = ( MyRecord ) row.get( "oRecord" );         **
>        System.out.println( $oRecord.toString() + "\n" );
>    }
> end
>
>
> ** - I get no viable alternative at input on these 3 lines.  Usually
> missing
> ) or " but I don't see an issue.
>
> Thanks!
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/query-examples-tp1787542p1787542.html
> Sent from the Drools - Dev mailing list archive at Nabble.com.
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20101028/cdb07d7b/attachment.html 


More information about the rules-dev mailing list