hi, <div><br><div>if i have <span style="background-color:rgb(51,102,255)">package</span> with name <font color="#ffffff" style="background-color:rgb(51,51,255)">my package</font> in drools guvnor</div><div><br></div><div>
 In that i have some rules(<span style="background-color:rgb(51,51,255)">business rule assets</span>), with name testrule1, testrule2</div><div><br></div><div>if i want to access those rules to my java application</div><div>
<br></div><div>i have written resource url in changeset like</div><div><br></div><div><span style="background-color:rgb(255,255,51)">&lt;resource source=&#39;<a href="http://localhost:8080/drools-guvnor/rest/packages/mypackage/source">http://localhost:8080/drools-guvnor/rest/packages/mypackage/source</a>&#39; type=&#39;BRL&#39;/&gt;</span></div>
<div><br></div><div>but i am getting exceptions..</div><div><br></div><div><span style="background-color:rgb(51,102,255)">Exception in thread &quot;main&quot; java.lang.RuntimeException: org.drools.compiler.DroolsParserException: java.lang.IllegalArgumentException: Unable to instantiate service for Class &#39;org.drools.compiler.BusinessRuleProvider&#39;</span></div>
<div><br></div><div><br>please help me.. to write correct url in changeset.xml to access those BRL&#39;s</div><div><br></div><div>thanks</div><div>sai</div><div><br></div><div><br><div class="gmail_quote">On Fri, Oct 19, 2012 at 2:25 PM, Jervis Liu <span dir="ltr">&lt;<a href="mailto:jliu@redhat.com" target="_blank">jliu@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><div class="im">
    <div>On 2012/10/16 19:47, Ravikiran wrote:<br>
    </div>
    <blockquote type="cite">
      <pre>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></div>
    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:<div class="im"><br>
    <br>
    &lt;change-set xmlns=&#39;<a href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a>&#39;<br>
        xmlns:xs=&#39;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&#39;<br>
        xs:schemaLocation=&#39;<a href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a>
    <a href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd" target="_blank">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd</a>&#39;
    &gt;<br>
        &lt;add&gt;<br></div>
             &lt;resource  
    source=&#39;<a href="http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/assets/sss/source" target="_blank">http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/assets/sss/source</a>&#39;
    type=&#39;DRL&#39; /&gt;<br>
        &lt;/add&gt;<br>
    &lt;/change-set&gt;<br>
    <br>
    If you want to use a specific version of asset &quot;sss&quot;, 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>
             &lt;resource  
source=&#39;<a href="http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/assets/sss/" target="_blank">http://localhost:8080/drools-guvnor/rest/packages/defaultPackage/assets/sss/</a><a>versions/2/source</a>&#39; type=&#39;DRL&#39; /&gt;<br>

    <br>
    This is to get version 2 of asset &quot;sss&quot; source.<br>
    <br>
    <br>
    Cheers,<br>
    Jervis<div><div class="h5"><br>
    <br>
    <blockquote type="cite">
      <pre>I can only get the package or rule asset&#39;s metadata using the urls that you
have mentioned in your post. But i can&#39;t fire the rules...please suggest if
i am doing something wrong.

changeset-loans.xml
-------------------------
&lt;change-set xmlns=&#39;<a href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a>&#39;
    xmlns:xs=&#39;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&#39;
    xs:schemaLocation=&#39;<a href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a>
   
<a href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd" target="_blank">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd</a>&#39;
</pre>
      <blockquote type="cite">
        <pre></pre>
      </blockquote>
      <pre>   &lt;add&gt;
      &lt;resource
     
source=&#39;<a href="http://localhost:9080/guvnor-5.2.0.Final-tomcat-6.0/org.drools.guvnor.Guvnor/package/loans/loans_demo.drl" target="_blank">http://localhost:9080/guvnor-5.2.0.Final-tomcat-6.0/org.drools.guvnor.Guvnor/package/loans/loans_demo.drl</a>&#39;
      type=&#39;DRL&#39; basicAuthentication=&quot;enabled&quot; username=&quot;admin&quot;
password=&quot;admin&quot; /&gt;
   &lt;/add&gt;
&lt;/change-set&gt;

Thanks
Ravi



--
View this message in context: <a href="http://drools.46999.n3.nabble.com/How-to-access-Guvnor-Rules-based-on-versions-from-Java-tp4020285p4020301.html" target="_blank">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 href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><strong>Regards</strong></div><div><strong><font size="4" face="garamond,serif" color="#6600cc">SAI BABA NADH</font></strong></div><div><p style="text-align:justify">
<font color="#6666cc" size="4" face="comic sans ms, sans-serif"><span style="line-height:14px">+91 7411680125</span></font></p></div><div></div><div><font color="#000066" face="garamond, serif" size="4"><b> </b></font></div>
<br><br><br>
</div></div>