<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'><div style="margin-left: 40px;"><span style="font-style: italic;">I am not sure if I understand you correctly. You want to return a
compiled package binary based on certain criteria or you want to
return individual assets based on certain criteria? </span><br></div>The main objective is the first one : get compiled package including filtred assert on certain criteria<br>But if I can do the second (get all assets having certain criteria), I can compile it myself.<br><br><div style="margin-left: 40px;">
<span style="font-style: italic;">If its the former, you can do this through Guvnor REST API (to be
precise, it is the new JAX-RS based REST api). In this case, you
dont provide filters through the URL. When you hit the REST URL for
example </span><a style="font-style: italic;" class="moz-txt-link-freetext" href="http://localhost:8080/drools-guvnor/rest/packages/mortgage" target="_blank">http://localhost:8080/drools-guvnor/rest/packages/mortgage</a><span style="font-style: italic;">,
the REST service will first check if this package's binary is
up-to-date. If not, it will build the package first, then return
compiled binary. It is the Guvnor selector in charge of which assets
get into the build. At the moment, we dont have a REST API to
control which selector is taking effect during the build, but if
this is what you need, I am sure we can figure this out.</span><br></div>It is exactly that : be able to choose the filter used to compile the package.<br><br><br><div style="margin-left: 40px;"><span style="font-style: italic;">If what you want is to return individual assets, you can send a HTTP
GET request to URL </span><a style="font-style: italic;" class="jive-link-wiki-small" href="http://community.jboss.org/docs/DOC-16217" target="_blank">http://host:portnumber/drools-guvnor/rest/packages/mortgage/assets</a><span style="font-style: italic;">
with Accept="application/atom+xml", this returns a list of assets
under the mortgage package in Atom feed format. </span><br style="font-style: italic;"><em>...</em><br style="font-style: italic;"><span style="font-style: italic;">For example a GET request to </span><a style="font-style: italic;" class="jive-link-wiki-small" href="http://community.jboss.org/docs/DOC-16217" target="_blank">http://host:portnumber/</a><a style="font-style: italic;" class="jive-link-external-small" href="http://localhost:9080/repository/packages/testPackage1/assets" target="_blank">drools-guvnor/rest</a><a style="font-style: italic;" class="jive-link-external-small" href="http://localhost:9080/repository/packages/packageName/asset/testAsset2" target="_blank">/packages/mortgage/assets</a><a style="font-style: italic;" class="jive-link-wiki-small" href="http://community.jboss.org/docs/DOC-16217" target="_blank">/testAsset1</a><span style="font-style: italic;">
with Accept="application/atom+xml" returns an atom entry which is
the meta data info of that asset. </span><br></div>The links you provide and these sample seems really great to access some internal values of repository, and even do updates to programmatically ... but ... I can't get it work ... may be I hit my limits on web-base things here ... So lots of questions :<br> - I don't understand when you say "with Accept="application/atom+xml" : what is "with" ? URL parameters like <a class="jive-link-wiki-small" href="http://community.jboss.org/docs/DOC-16217" target="_blank">http://host:portnumber/drools-guvnor/rest/packages/mortgage/assets</a>?Accept="application/atom+xml" ? Guess not according to what you say after. So what is "with", how do you provide these args to the URL ?<br><br> - when I try the URL given "as this" ( <a class="jive-link-wiki-small" href="http://community.jboss.org/docs/DOC-16217" target="_blank">http://host:portnumber/drools-guvnor/rest/packages/mortgage/assets</a> ) tomcat replies that there is no service. I get something to work with this URL <a href="">http://localhost:8080/drools-5.2.0.M1-guvnor/org.drools.guvnor.Guvnor/api/packages/mortgages</a> , ie adding "org.drools.guvnor.Guvnor", with "api" instead of "rest", and without "assets" (which tells me that the "assets" is not a valid path). Does this mean that I am not running the correct version ? Need to deploy something else ? Need to configure something ?<br><br> - with my URL form, I can get the content of a package (raw text, one resource by line) like this :<br><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">drools.package=2008-09-30T03:36:29,1</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">MortgageModel.model.drl=2008-10-22T22:01:14,6</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">Underage.brl=2008-10-01T04:54:34,2</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">...</span><br><br> - or one rule (http://localhost:8080/drools-5.2.0.M1-guvnor/org.drools.guvnor.Guvnor/api/packages/mortgages/RegexDslRule.brl) :<br>
<span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><rule></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> <name>RegexDslRule</name></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> <modelVersion>1.0</modelVersion></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> <attributes/></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> <metadataList/></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> <lhs></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> <dslSentence></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> <sentence>When the ages is less than {57:1?[0-9]?[0-9]}</sentence></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> </dslSentence></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> </lhs></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"> <rhs/></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"></rule></span><br>I noticed a <span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">metadataList </span>there, but empty ... and I explicitely set some metadata in that rule in guvnor before query it. What should go there ? Annotations ?<br><br><div style="margin-left: 40px; font-style: italic;">JAX-RS does support query using URL like <a class="jive-link-wiki-small" href="http://community.jboss.org/docs/DOC-16217" target="_blank">http://host:portnumber/drools-guvnor/rest/packages/mortgage/assets</a>?category=foo&category=bar&status=prod
(and several other query mechanisms). But we have not implemented
query in Guvnor yet. Of course you will be very welcome if you
want to help ;-)<br></div>Yep why not ... if you don't find my previous questions too stupid :)<br>For now we will try to make the business user arrange their rules directly in different packages and then query the package "as usual" for each rule app we have<br>But it is quite sure that this won't fit their needs in a real living application where rules numbers will grow .... as for rule apps<br><br>Thanks a lot for you time anyway</div></body></html>