Bug 973264

Summary: Star import does not work with DRL declared facts
Product: [Retired] JBoss BRMS Platform 6 Reporter: Marek Winkler <mwinkler>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED CURRENTRELEASE QA Contact: Marek Winkler <mwinkler>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: rzhang
Target Milestone: ER2   
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:17:19 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 Marek Winkler 2013-06-11 15:01:28 UTC
Description of problem:

Given the following DRL:

package org.drools.compiler.integrationtests

import org.drools.compiler.integrationtests.facts.*

declare TestEvent
    @role(event)
end

rule "SendEvent"
	when
		$event : TestEvent()
	then
        // rule fired
end

When an instance of TestEvent is inserted into KieSession and then fireAllRules() called, the rule does not fire.

If the import statement is changed to the following

import org.drools.compiler.integrationtests.facts.TestEvent

the rule fires as expected.

The problem is not present when using old API (KnowledgeBase), so this is a regression.

The tricky part is, that no error is reported, the engine just behaves as if the fact declared in DRL and the fact imported from Java were two different facts.

Version-Release number of selected component (if applicable):

BRMS 6.0.0 DR5
Drools 6.0.0.Beta3
Drools 6.0.0-SNAPSHOT

How reproducible:

Run the StarImportTest from attached pull request (will add reference to the pull request shortly).

Actual results:

The rule does not fire.

Expected results:

The rule fires.

Comment 1 Marek Winkler 2013-06-11 15:04:13 UTC
Pull request with reproducer: https://github.com/droolsjbpm/drools/pull/213

Comment 2 Mario Fusco 2013-07-25 11:58:34 UTC
Fixed on CR2.

Comment 3 Marek Winkler 2013-09-02 09:09:10 UTC
Verified on BRMS 6.0.0-ER2.