[jboss-jira] [JBoss JIRA] (DROOLS-339) Rules will only fire in the first session created from a knowledgebase - Segment Memory restore from Prototype conflict

RH Bugzilla Integration (JIRA) jira-events at lists.jboss.org
Thu Nov 14 03:54:06 EST 2013


    [ https://issues.jboss.org/browse/DROOLS-339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12923414#comment-12923414 ] 

RH Bugzilla Integration commented on DROOLS-339:
------------------------------------------------

Mario Fusco <mfusco at redhat.com> made a comment on [bug 1030251|https://bugzilla.redhat.com/show_bug.cgi?id=1030251]

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.
                
> Rules will only fire in the first session created from a knowledgebase - Segment Memory restore from Prototype conflict
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: DROOLS-339
>                 URL: https://issues.jboss.org/browse/DROOLS-339
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 6.0.0.CR5
>            Reporter: Davide Sottara
>            Assignee: Mario Fusco
>            Priority: Blocker
>
> Given a KB with the two rules below: 
> {code}
>  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
> {code}
> 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.
> See SegmentUtilities line 421, where this tentative patch shows the problem:
> {code}
> if ( NodeTypeEnums.isLeftTupleSource(node) &&  wm.getNodeMemory((MemoryFactory) node).getSegmentMemory() == null )
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list