Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-280

lock-on-active broken

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 6.0.0.Final
    • 6.0.0.CR4
    • None
    • None

    Description

      Hi,
      lock-on-active is not working as expected.
      I seems to work as activation-group.

      Works fine with 5.x
      Fails with 6.0.0 CR3 and CR4

      Fact:

      public class Poc implements Serializable {
      
      	private static final long serialVersionUID = 1L;
      
      	private long id = 1;
      	private boolean test1 = false;
      	private boolean test2 = false;
      	private int foundTest = 0;
      ...
      }
      

      Rule:

      rule "test1"
      lock-on-active 
      dialect "mvel"
          when
          	$poc:Poc( isTest1() )
          then
          	System.out.println("test1 found");
          	modify($poc) { setFoundTest($poc.getFoundTest() + 1) }    	
      end
      
      
      rule "test2"
      lock-on-active 
      dialect "mvel"
          when
          	$poc:Poc( isTest2() )
          then
          	System.out.println("test2 found");
          	modify($poc) { setFoundTest($poc.getFoundTest() + 1) }    	
      end
      

      Test:

      @Test
      public void lockOnActiveTest() {
      	// Get the Knowledge base from the DRL file 
      	KieSession kSession = getSF();
      			
      	Poc poc = new Poc();
      	poc.setTest1(true);
      	poc.setTest2(true);
      	
      	kSession.insert(poc);
      	
      	// Fire the rules
      	kSession.fireAllRules();
      	
      	assertTrue("broken",poc.getFoundTest()==2);
      	
      	// Clean up
      	kSession.dispose();
      }
      

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            apatrici Anthony Patricio
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: