1 Reply Latest reply on Jun 7, 2006 2:15 AM by Ahmed Adly

    [URGENT] JBoss Rules and facts of the same type

    Ahmed Adly Newbie

      I have a question:
      How to make the Rule Engine (Drools 3) to fire a rule in such a way.
      For example:

      if I have a rule just like this:

       rule "test 1"
      
       when
       test1 : String()
       test2 : String()
       then
       System.out.println( "test1 = "+test1 );
       System.out.println( "test2 = "+test2 );
      
       end
      


      and i have a piece of code just like this:
       workingMemory.assertObject("STRING1");
       workingMemory.assertObject("STRING2");
       workingMemory.fireAllRules();
      

      If I run this code it will executed 2 times (the first to assert "STRING1" to test1 and "STRING2" to test2) and (the second to assert "STRING2" to test1 and "STRING1" to test2)

      I do not want the Drools to do this.
      Is there a way to explicit assign the first asserted object to the first refrence in the fact and the second asserted object to the second fact?
      I do not want to check the value in LHS of the rule.
      Any help will be appreciated