The problem seems to be that the Guvnor API only accepts application/atom+xml for the "Create Asset" Restful POST call. Problematic on my end since I'd prefer to use JSON. This is kind of discouraging as well, since all other REST calls accept JSON/XML/Atom.
The Atom/XML worked for me. I was missing the SLUG header, once I added that, I could create the WID thru the REST interface.
Could you explain how to add the Slug header? How did you modify your code in this example?
I am able to create an asset, but I cannot link to a global asset. For instance I want to link to a global model with the REST API, how would I go about doing that?
That was helpful, thanks! This is how I did it in case someone else wonders.
WebClient client = WebClient.create("http://" + guvnorHost + ":" + guvnorPort);
MultivaluedMap<String, String> map = new MetadataMap<String, String>();
List<String> slugHeader = new ArrayList<String>();
List<String> authHeader = new ArrayList<String>();
List<String> contentTypeHeader = new ArrayList<String>();
Response response = client.path("drools-guvnor/rest/packages/" + packageName + "/assets").accept("application/atom+xml").post(asset);
does anyone know how to create an POJO model asset with REST API?
" but the format is by default "txt"...
I too am interested in solution to this problem.
Has anyone found workaround for this?
I want to link to a global model with the REST API, how would I go about doing that?
Im also looking to do the same. Did anyone find a solution to creating a new rule that uses a pojo in the global package?
Sorry, it can't be done with the REST API. I had to use java code to do it and I wrapped it in my own REST API. I would post the code but I'm no longer working on that project and don't have access to it anymore.