<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 2012/10/19 17:56, Sai Nadh wrote:<br>
    </div>
    <blockquote
cite="mid:CAF9R-q59QQ_yJvv4dC-HSHfJid4zia+xs188Rqh1Ud8wRzRAmg@mail.gmail.com"
      type="cite">hi,&nbsp;
      <div><br>
        <div>if i have <span style="background-color:rgb(51,102,255)">package</span>
          with name <font style="background-color:rgb(51,51,255)"
            color="#ffffff">my package</font> in drools guvnor</div>
        <div><br>
        </div>
        <div>
          &nbsp;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='<a moz-do-not-send="true"
href="http://localhost:8080/drools-guvnor/rest/packages/mypackage/source">http://localhost:8080/drools-guvnor/rest/packages/mypackage/source</a>'
            type='BRL'/&gt;</span></div>
      </div>
    </blockquote>
    <br>
    <div><br>
    </div>
    <div><span style="background-color:rgb(255,255,51)">&lt;resource
        source='<a moz-do-not-send="true"
href="http://localhost:8080/drools-guvnor/rest/packages/mypackage/source">http://localhost:8080/drools-guvnor/rest/packages/mypackage/assets/testrule1/source</a>'
        type='BRL'/&gt;<br>
        <br>
      </span><a id="d0e3182">Check the doc for details:
http://docs.jboss.org/drools/release/5.5.0.Beta1/drools-guvnor-docs/html/ch09.html#d0e3153<br>
      </a><br>
    </div>
    <blockquote
cite="mid:CAF9R-q59QQ_yJvv4dC-HSHfJid4zia+xs188Rqh1Ud8wRzRAmg@mail.gmail.com"
      type="cite">
      <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 "main" java.lang.RuntimeException:
            org.drools.compiler.DroolsParserException:
            java.lang.IllegalArgumentException: Unable to instantiate
            service for Class 'org.drools.compiler.BusinessRuleProvider'</span></div>
        <div><br>
        </div>
        <div><br>
          please help me.. to write correct url in changeset.xml to
          access those BRL'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 moz-do-not-send="true"
                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='<a moz-do-not-send="true"
                    href="http://drools.org/drools-5.0/change-set"
                    target="_blank">http://drools.org/drools-5.0/change-set</a>'<br>
                  &nbsp;&nbsp;&nbsp; xmlns:xs='<a moz-do-not-send="true"
                    href="http://www.w3.org/2001/XMLSchema-instance"
                    target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>'<br>
                  &nbsp;&nbsp;&nbsp; xs:schemaLocation='<a moz-do-not-send="true"
                    href="http://drools.org/drools-5.0/change-set"
                    target="_blank">http://drools.org/drools-5.0/change-set</a>
                  <a moz-do-not-send="true"
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>'
                  &gt;<br>
                  &nbsp;&nbsp;&nbsp; &lt;add&gt;<br>
                </div>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;resource&nbsp;&nbsp; source='<a
                  moz-do-not-send="true"
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>'
                type='DRL' /&gt;<br>
                &nbsp;&nbsp;&nbsp; &lt;/add&gt;<br>
                &lt;/change-set&gt;<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>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;resource&nbsp;&nbsp;
                source='<a moz-do-not-send="true"
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
                  moz-do-not-send="true">versions/2/source</a>'
                type='DRL' /&gt;<br>
                <br>
                This is to get version 2 of asset "sss" 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'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
-------------------------
&lt;change-set xmlns='<a moz-do-not-send="true" href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a>'
    xmlns:xs='<a moz-do-not-send="true" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>'
    xs:schemaLocation='<a moz-do-not-send="true" href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a>
   
<a moz-do-not-send="true" 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>'
</pre>
                      <blockquote type="cite"> </blockquote>
                      <pre>   &lt;add&gt;
      &lt;resource
     
source='<a moz-do-not-send="true" 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>'
      type='DRL' basicAuthentication="enabled" username="admin"
password="admin" /&gt;
   &lt;/add&gt;
&lt;/change-set&gt;

Thanks
Ravi



--
View this message in context: <a moz-do-not-send="true" 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 moz-do-not-send="true" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true" 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 moz-do-not-send="true"
                href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
              <a moz-do-not-send="true"
                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" color="#6600cc"
                face="garamond,serif">SAI BABA NADH</font></strong></div>
          <div>
            <p style="text-align:justify">
              <font size="4" color="#6666cc" face="comic sans ms,
                sans-serif"><span style="line-height:14px">+91
                  7411680125</span></font></p>
          </div>
          <div><font size="4" color="#000066" face="garamond, serif"><b>&nbsp;</b></font></div>
          <br>
          <br>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
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>