Bug 1030251

Summary: Rules will only fire in the first session created from a knowledgebase - Segment Memory restore from Prototype conflict
Product: [Retired] JBoss BRMS Platform 6 Reporter: Mario Fusco <mfusco>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED CURRENTRELEASE QA Contact: Marek Winkler <mwinkler>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.0.0   
Target Milestone: ER5   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:20:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mario Fusco 2013-11-14 08:52:09 UTC
Given a KB with the two rules below:

 rule "Insert Info "
 when
 then
     insert(  "aaa " );
     insert( new Integer( 12 ) );
     insert( new Double( 4.0 ) );
 end
 
 rule "React "
 when
     Integer()
     accumulate (
                  $n : Double( ) and
                       Double(  ),
                  $x : count( $n )
                )
     String( )
 then
     System.out.println(  "Rule fires" );
 end

The rules work normally in the first session created from the KB.
When any additional session is created and used, the SegmentMemories are restored from the SM Prototypes.
Unfortunately, the AccumulateNode -> RuleTerminalNode segment is restored twice, once when the "aaa"
triggers the appropriate Beta Node, and once when the subnetwork updates the RIA node.
The latter overwrites the already existing segment, overriding the partial link bits.

Comment 1 Mario Fusco 2013-11-14 08:53:06 UTC
Fixed by https://github.com/droolsjbpm/drools/commit/5156993b9

Comment 2 JBoss JIRA Server 2013-11-14 08:54:26 UTC
Mario Fusco <mario.fusco> updated the status of jira DROOLS-339 to Resolved

Comment 4 Marek Winkler 2013-12-12 15:59:05 UTC
Verified on BRMS 6.0.0 ER5.