<div dir="ltr">About 1, <span style="font-family:arial,sans-serif;font-size:13.333333969116211px">.../rest/packages/{</span><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">packageName}/binary will triger the compile and then return the PKG. But not sure what will happen if the compilation fails.. you can try!</span><div>
<span style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></span></div><div style><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">From the documentation:</span></div><div style>
<a id="d0e1762" style="color:rgb(51,51,51);font-family:&#39;Lucida Grande&#39;,Geneva,Verdana,Arial,sans-serif;font-size:12px;line-height:18px;text-align:justify"><div class=""><table summary="Accessing Rule Assets by Package" border="1" style="border:1px solid rgb(170,170,170);width:901px;border-collapse:collapse">
<tbody><tr><td style="border-style:none;padding:0.15em 0.5em">Returns the compiled binary of the package {packageName} as a binary stream. If the package has not been compiled yet or its binary is not up to date, this will compile the package first.<br>
</td></tr></tbody></table></div></a></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 4, 2013 at 8:06 PM, anchi <span dir="ltr">&lt;<a href="mailto:harijana@ovi.com" target="_blank">harijana@ovi.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok, I somehow managed to resolve question 3 and 3.a. But questions 1. and 2.<br>
remain, please point me to the right direction.<br>
<br>
What I need is to build a package and if build was successful then create a<br>
new snapshot.<br>
My problem is how to build a package?<br>
<br>
I found out that creating a new snapshot by calling<br>
.../rest/packages/{packageName}/snapshot/{snapshotName} *sometimes* triggers<br>
package build. But I cannot figure out how is this determined?<br>
<br>
What I&#39;ve found out is:<br>
1. Approach that doesn&#39;t work:<br>
  - update package version by sending modified package metadata to<br>
.../rest/packages/{packageName} (I basically just change package<br>
description)<br>
  - then trigger creation of new snapshot with REST request<br>
It does not compile the package<br>
<br>
2. Approach that works:<br>
 - click Save in Guvnor console (which changes package version)<br>
 - then trigger creation of new snapshot with REST request<br>
Package is compiled<br>
<br>
So where is the catch? How can I make sure that package is built before<br>
creating a snapshot?<br>
I don&#39;t really see a point of having a REST interface if it still requires<br>
to use Guvnor console for being able to use a knowledge base packages....<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Guvnor-REST-api-compile-package-tp4025756p4025811.html" target="_blank">http://drools.46999.n3.nabble.com/Guvnor-REST-api-compile-package-tp4025756p4025811.html</a><br>

<div class="HOEnZb"><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
</div></div></blockquote></div><br></div>