[jboss-jira] [JBoss JIRA] (DROOLS-891) Missing alpha node removal when the only rule using it is removed

RH Bugzilla Integration (JIRA) issues at jboss.org
Thu Nov 5 08:51:01 EST 2015


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

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

Mario Fusco <mfusco at redhat.com> changed the Status of [bug 1273087|https://bugzilla.redhat.com/show_bug.cgi?id=1273087] from ASSIGNED to MODIFIED

> Missing alpha node removal when the only rule using it is removed
> -----------------------------------------------------------------
>
>                 Key: DROOLS-891
>                 URL: https://issues.jboss.org/browse/DROOLS-891
>             Project: Drools
>          Issue Type: Bug
>            Reporter: Mario Fusco
>            Assignee: Mario Fusco
>             Fix For: 6.3.0.CR2
>
>
> When an alpha node has more than one sink and it is used by only one rule doesn't get removed when the rule itself is removed. The following test case demonstrates the problem.
> {code}
>     @Test
>     public void testRemoveHasSameConElement() {
>         String packageName = "test";
>         String rule1 = "package " + packageName + ";" +
>                        "import java.util.Map; \n" +
>                        "rule 'rule1' \n" +
>                        "when \n" +
>                        " Map(this['type'] == 'Goods' && this['brand'] == 'a') \n" +
>                        " Map(this['type'] == 'Goods' && this['category'] == 'b') \n" +
>                        "then \n" +
>                        "System.out.println('test rule 1'); \n"+
>                        "end";
>         KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
>         kbuilder.add( ResourceFactory.newByteArrayResource( rule1.getBytes() ), ResourceType.DRL );
>         if ( kbuilder.hasErrors() ) {
>             fail( kbuilder.getErrors().toString() );
>         }
>         KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
>         kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
>         kbase.removeKnowledgePackage(packageName);
>         StatelessKnowledgeSession session = kbase.newStatelessKnowledgeSession();
>         session.execute(new HashMap());
>     }
> {code} 



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list