Bug 1025824 - lock-on-active broken
lock-on-active broken
Status: CLOSED CURRENTRELEASE
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
6.0.0
Unspecified Unspecified
high Severity high
: ER5
: 6.0.0
Assigned To: Mario Fusco
Marek Winkler
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-01 12:53 EDT by Mario Fusco
Modified: 2014-08-06 16:17 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-06 16:17:22 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker DROOLS-280 Major Resolved lock-on-active broken 2013-12-13 02:27:08 EST

  None (edit)
Description Mario Fusco 2013-11-01 12:53:12 EDT
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();
}
Comment 1 JBoss JIRA Server 2013-11-01 12:53:46 EDT
Mario Fusco <mario.fusco@gmail.com> updated the status of jira DROOLS-280 to Resolved
Comment 2 Mario Fusco 2013-11-01 12:54:27 EDT
Fixed by https://github.com/droolsjbpm/drools/commit/1ccbc2013
Comment 4 Marek Winkler 2013-12-13 02:23:21 EST
Verified on BRMS 6.0.0 ER5.

Note You need to log in before you can comment on or make changes to this bug.