<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 2012/10/16 19:47, Ravikiran wrote:<br>
</div>
<blockquote cite="mid:1350388039363-4020301.post@n3.nabble.com"
type="cite">
<pre wrap="">Hi Jarvis,
Thanks for your reply. Looks like i have posted my intension unclearly. To
elaborate bit more, currently i am using Rest API to create KnowledgeBase
from my java client. I have changeset-loans.xml, where my guvnor package
with drl is defined. My java client will this to fire all rules of that
package. In such a case, when i have more one version created for the
package and the rule assets within it, how i can i call specific version
based package along with the drl file to fire all the rule assets belongs to
it? In the same passion, is there any way i can mentioned the rule asset
name in the changeset xml file to fire specific version of rule asset from
java?</pre>
</blockquote>
Yes, it is possible to specify a specific version of asset in
changeset. though this is not supported by Change-set editor at the
moment, you have to edit the content of change-set xml file
manually. For example, below is generated by change-set editor:<br>
<br>
<change-set xmlns='<a class="moz-txt-link-freetext" href="http://drools.org/drools-5.0/change-set">http://drools.org/drools-5.0/change-set</a>'<br>
xmlns:xs='<a class="moz-txt-link-freetext" href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>'<br>
xs:schemaLocation='<a class="moz-txt-link-freetext" href="http://drools.org/drools-5.0/change-set">http://drools.org/drools-5.0/change-set</a>
<a class="moz-txt-link-freetext" href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd</a>'
><br>
<add><br>
<resource
source='<a class="moz-txt-link-freetext" href="http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/assets/sss/source">http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/assets/sss/source</a>'
type='DRL' /><br>
</add><br>
</change-set><br>
<br>
If you want to use a specific version of asset "sss", what you need
to do is to modify the source URL, make it pointing to the specific
version of the asset source. eg:<br>
<br>
<resource
source='<a class="moz-txt-link-freetext" href="http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/assets/sss/">http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/assets/sss/</a><a
id="d0e3182">versions/2/source</a>' type='DRL' /><br>
<br>
This is to get version 2 of asset "sss" source.<br>
<br>
<br>
Cheers,<br>
Jervis<br>
<br>
<blockquote cite="mid:1350388039363-4020301.post@n3.nabble.com"
type="cite">
<pre wrap="">
I can only get the package or rule asset's metadata using the urls that you
have mentioned in your post. But i can't fire the rules...please suggest if
i am doing something wrong.
changeset-loans.xml
-------------------------
<change-set xmlns='<a class="moz-txt-link-freetext" href="http://drools.org/drools-5.0/change-set">http://drools.org/drools-5.0/change-set</a>'
xmlns:xs='<a class="moz-txt-link-freetext" href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>'
xs:schemaLocation='<a class="moz-txt-link-freetext" href="http://drools.org/drools-5.0/change-set">http://drools.org/drools-5.0/change-set</a>
<a class="moz-txt-link-freetext" href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd</a>'
</pre>
<blockquote type="cite">
<pre wrap="">
</pre>
</blockquote>
<pre wrap=""> <add>
<resource
source='<a class="moz-txt-link-freetext" href="http://localhost:9080/guvnor-5.2.0.Final-tomcat-6.0/org.drools.guvnor.Guvnor/package/loans/loans_demo.drl">http://localhost:9080/guvnor-5.2.0.Final-tomcat-6.0/org.drools.guvnor.Guvnor/package/loans/loans_demo.drl</a>'
type='DRL' basicAuthentication="enabled" username="admin"
password="admin" />
</add>
</change-set>
Thanks
Ravi
--
View this message in context: <a class="moz-txt-link-freetext" href="http://drools.46999.n3.nabble.com/How-to-access-Guvnor-Rules-based-on-versions-from-Java-tp4020285p4020301.html">http://drools.46999.n3.nabble.com/How-to-access-Guvnor-Rules-based-on-versions-from-Java-tp4020285p4020301.html</a>
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>