Bug 724508 (BRMS-454)

Summary: Rule attributes declared in package level using Guvnor don't work
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Alessandro Lazarotti <alazarot>
Component: BRM (Guvnor)Assignee: Tihomir Surdilovic <tsurdilo>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: high    
Version: 5.0.2, 5.1.0.ER3CC: lcarlon
Target Milestone: ---   
Target Release: BRMS 5.2.0.GA   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/BRMS-454
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
<remark>NeedInfo from Tihomir - Please state how this issue was resolved.</remark></para><para>Rule attributes declared at the package level with Guvnor were being ignored by the knowledgeAgent.
Story Points: ---
Clone Of: Environment:
JBoss Enterprise BRMS 5.0.2/5.1 R3, JDK sun 1.6, Fedora 12
Last Closed: 2011-06-02 22:04:04 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:

Description Alessandro Lazarotti 2010-11-23 18:09:34 UTC
Steps to Reproduce: Example of the rule:

declare Fact
	field: String
	factname: String
end


rule "Rule1"
dialect "mvel"
when
	$f : Fact( factname == "Alessandro" )
then
	System.out.println("something");
	$f.setField( Lazarotti" );
	update( $f );
end

To configure the rule attributes by package, in guvnor:

For settings in the package level:
1) In Guvnor, click on the package
2) In Configuration, click on Advanced View
3) Type in textarea of "Configuration" your setup, like: no-loop true
4) Save and validate configuration
5) Create snapshot ...
6) Look "Show package source URL", you should see the package with your configuration:

1.	|	package ale1
2.	|	no-loop true

Although the source seems correct, the agent will ignore the attributes on package level.
Workaround: Workaround Exists
Workaround Description: The bug is the binary package created and provided in an URL by Guvnor and serialized to KnowledgeAgent in the client side.
As workaround, you must change in client the URL that points to the binary to another that points to the DRL, provided by Guvnor. 

For example:

(change-set.xml in client side)

<resource source="http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/case00371066/LATEST" type="PKG"/>


Should be changed to:

         <resource source="http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/case00371066/LATEST.drl" type="DRL"/>
securitylevel_name: Public

When defined rule attributes in package level using Guvnor, the same is ignored by agent

Comment 2 Alessandro Lazarotti 2010-11-23 18:13:07 UTC
Link: Added: This issue is related to GUVNOR-1104


Comment 3 Alessandro Lazarotti 2010-11-25 17:05:56 UTC
Workaround Description: Removed: declare attributes in rule level Added: The bug is the binary package created and provided in an URL by Guvnor and serialized to KnowledgeAgent in the client side.
As workaround, you must change in client the URL that points to the binary to another that points to the DRL, provided by Guvnor. 

For example:

(change-set.xml in client side)
<change-set xmlns='http://drools.org/drools-5.0/change-set'
    xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
    xs:schemaLocation='http://drools.org/drools-5.0/change-set http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd' >
    <add>
         <resource source='http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/case00371066/LATEST' type="PKG"/>
    </add>
</change-set>

Should be changed to:

<change-set xmlns='http://drools.org/drools-5.0/change-set'
    xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
    xs:schemaLocation='http://drools.org/drools-5.0/change-set http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd' >
    <add>
         <resource source='http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/case00371066/LATEST.drl' type="DRL"/>
    </add>
</change-set>


Comment 4 Alessandro Lazarotti 2010-11-25 17:08:49 UTC
Workaround Description: Removed: The bug is the binary package created and provided in an URL by Guvnor and serialized to KnowledgeAgent in the client side.
As workaround, you must change in client the URL that points to the binary to another that points to the DRL, provided by Guvnor. 

For example:

(change-set.xml in client side)
<change-set xmlns='http://drools.org/drools-5.0/change-set'
    xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
    xs:schemaLocation='http://drools.org/drools-5.0/change-set http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd' >
    <add>
         <resource source='http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/case00371066/LATEST' type="PKG"/>
    </add>
</change-set>

Should be changed to:

<change-set xmlns='http://drools.org/drools-5.0/change-set'
    xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
    xs:schemaLocation='http://drools.org/drools-5.0/change-set http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd' >
    <add>
         <resource source='http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/case00371066/LATEST.drl' type="DRL"/>
    </add>
</change-set> Added: The bug is the binary package created and provided in an URL by Guvnor and serialized to KnowledgeAgent in the client side.
As workaround, you must change in client the URL that points to the binary to another that points to the DRL, provided by Guvnor. 

For example:

(change-set.xml in client side)

<resource source="http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/case00371066/LATEST" type="PKG"/>


Should be changed to:

         <resource source="http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/case00371066/LATEST.drl" type="DRL"/>


Comment 5 lcarlon 2011-08-25 02:53:45 UTC
Hi Tihomir,

You resolved this in BRMS-454, please provide consequence, cause, fix, and result for the release notes.

Comment 6 lcarlon 2011-09-21 05:37:07 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
<remark>NeedInfo from Tihomir - Please state how this issue was resolved.</remark></para><para>Rule attributes declared at the package level with Guvnor were being ignored by the knowledgeAgent.