This must be the problem I had too.
see "getQueryResults always returns null in drools 3.0.4"

It's fixed in the head of 3.0.x.
However when I execute my query twice, the results are wrong the second time:

query "multipleLessonsPerTeacherPerTimeslot"
    $lesson : Lesson($id : id, $teacher : teacher, $timeslot : timeslot);
    exists Lesson(id > $id, teacher == $teacher, timeslot == $timeslot);
end

If there are 3 lessons in the same timeslot, the first time the query behaves correctly: 2 lessons are found. the second time it's run it finds 3 lessons.


You can try it yourself:
svn co https://svn.sourceforge.net/svnroot/taseree/trunk
and "mvn install eclipse:eclipse" it.
Make sure you've "mvn install" the drools branch first.
Taseree is a project where I am combining tabu search with rule engine evaluation.

With kind regards,
Geoffrey De Smet


Edson Tirelli wrote:

  Claumir,

I'm sorry, but I was not able to reproduce the problem. Can you check if the problem happens in the most recent version of the branch (3.0.x)? Or maybe, if you can zip a self-contained test that I can run here, I'm sure that it will be easy to fix in case the problem still exists.

  Thank you,
    Edson


PS: I added an integration test for it in 3.0.x branch anyway.

Edson Tirelli wrote:


  Claumir,

   It seems to be the same problem reported here:

http://jira.jboss.com/jira/browse/JBRULES-532

   I will take a look at it.

   Edson

PS: nice to see more brazilians using JBRules.

Claumir Claudino dos Santos wrote:

Hello,

I wrote a .drl file with two simple queries, but when I run
the query "q1" (see drl file below), it always return null.

If I delete the query "q2" from file, works fine.
    in summary: if .drl has 2 or more queries, run any query
return null.

Any ideia?

I´m using 3.0.4.

Maybe this situation is similar to threat "getQueryResults
always returns null in drools3.0.4"? who knows?

thanks in advance


DRL file:
--------------
package teste

import br.com.dynamix.rules.test.O;
import java.util.Hashtable;

    /**
    *****************************************
    **/
    rule "conta A"
    salience 15;
        when
            $c1: O(id == "a")
        then
            System.out.println("There is an A");
    end

    /**
    *****************************************
    **/
    rule "conta B"
salience 10; when $c1: O(id == "b") then System.out.println("There is a B");
    end


    /**
    *****************************************
    **/
    query "q1"           c1: O(id == "a")       end

    /**
    *****************************************
    **/
query "q2" c2: O(id == "b") end








---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to