On 11/22/05, Rahmouni, Maher <[EMAIL PROTECTED]> wrote:
>
>
> Case 1:
> =======
>
> O1 = new myObject(1);
> O2 = new myObject(2);
>
> workingMemory.assert(O1);
> workingMemory.assert(O2);
> workingMemory.fireAllRules();
>
> In this case "Rule" get fired and I get the results:
> myObject 1 is different from myObject 2
> myObject 2 is different from myObject 1.
>
> Case 2:
> =======
>
> Vector data = new Vector();
>
> data.addElement(new myObject(1));
> data.addElement(new myObject(2));
>
> for(int i=0;i<data.size();i++)
> workingMemory.assertObject(data.elementAt(i));
>
> And I tried with casting too:
> for(int i=0;i<data.size();i++)
> workingMemory.assertObject((myObject)data.elementAt(i));
>
>
> In this case "Rule" doesn't get fired and surely nothing happens. When I
> check the Objects
> In the working memory by doing this:
> List objects = workingMemory.getObjects();
> System.out.println("List of Objects in the Memory:");
> for(int i=0;i<objects.size();i++)
> {
> System.out.println("myObject:
> "+((myObject)objects.get(i)).getId());
> }
>
> I get:
> myObject 1
> myObject 2
>Are you calling fireAllRules() in case 2? You don't make that clear. In any case, from what I can see, you're interacting with Drools the same way in both cases, so it doesn't seem to be a problem with Drools, but, rather, something you're doing differently. - Geoffrey -- Geoffrey Wiseman
