[rules-users] Guvnor - more than one resource in changeset.xml

Zahid Ahmed zahid.ahmed at emirates.com
Tue Aug 27 05:29:19 EDT 2013


Hi,

U can access assets from two different packages using one ChangeSet definition in Guvnor. Multiple "<resource>" tags can be defined in an add "<add>" tag. Following will be the configuration in ChangeSet
Note : "<ChangeSet>" tag can have only one tag and that tag will occur only once. Tags allowed in changeset.xsd are following,
	1. "<add>" tag
	2. "<remove>" tag

Change Set XSD : http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd 

[change set]
<add> 
	<resource
	source='http://server:8080/guvnor-tomcat/rest/packages/com.pkg1/source' 
	type='DRL' basicAuthentication="enabled" username="admin" password="admin"
	/>
	<resource
	source='http://server:8080/guvnor-tomcat/rest/packages/com.pkg2/source' 
	type='DRL' basicAuthentication="enabled" username="admin" password="admin"
	/>
</add>
[/changeset]


Now u will have to call "applyChangeSet" once, as u will be having one change Set referring more than one packages 

kagent.applyChangeSet(ResourceFactory.newClassPathResource("guvnor-tomcat-single-changeset.xml"));

Hope that answers your questions.

Regards,
Zahid Ahmed

-----Original Message-----
From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of rganesh84
Sent: 27 August 2013 12:22
To: rules-users at lists.jboss.org
Subject: [rules-users] Guvnor - more than one resource in changeset.xml

I have 2 packages in Guvnor UI having different set of rule assets in it.

pkg1 -> UI rules
pkg2 -> Business rules

In the java application code base, is it mandatory to have 2 change set xmls with different package contents?

[Java] // for UI rules
kagent.applyChangeSet(ResourceFactory.newClassPathResource("guvnor-tomcat-pkg1-changeset.xml"));
[/Java]

[Java] // for business rules
kagent.applyChangeSet(ResourceFactory.newClassPathResource("guvnor-tomcat-pkg2-changeset.xml"));
[/Java]

Can this be achieved having only one changeset holding multiple packaged rules?

[change set]
<add> 
	<resource
source='http://server:8080/guvnor-tomcat/rest/packages/com.pkg1/source' 
	type='DRL' basicAuthentication="enabled" username="admin" password="admin"
/>
</add>
[/changeset]

If i add a resource to add tag, how do I call it in Java code?



--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-more-than-one-resource-in-changeset-xml-tp4025690.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



More information about the rules-users mailing list