About 1, .../rest/packages/{packageName}/binary will triger the compile and then return the PKG. But not sure what will happen if the compilation fails.. you can try!

From the documentation:
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.


On Wed, Sep 4, 2013 at 8:06 PM, anchi <harijana@ovi.com> wrote:
Ok, I somehow managed to resolve question 3 and 3.a. But questions 1. and 2.
remain, please point me to the right direction.

What I need is to build a package and if build was successful then create a
new snapshot.
My problem is how to build a package?

I found out that creating a new snapshot by calling
.../rest/packages/{packageName}/snapshot/{snapshotName} *sometimes* triggers
package build. But I cannot figure out how is this determined?

What I've found out is:
1. Approach that doesn't work:
  - update package version by sending modified package metadata to
.../rest/packages/{packageName} (I basically just change package
description)
  - then trigger creation of new snapshot with REST request
It does not compile the package

2. Approach that works:
 - click Save in Guvnor console (which changes package version)
 - then trigger creation of new snapshot with REST request
Package is compiled

So where is the catch? How can I make sure that package is built before
creating a snapshot?
I don't really see a point of having a REST interface if it still requires
to use Guvnor console for being able to use a knowledge base packages....




--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-REST-api-compile-package-tp4025756p4025811.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users