1 Reply Latest reply on Jun 24, 2013 7:27 PM by Shane Claggett

    Author field failing to populate when created a new Guvnor asset using REST API

    Shane Claggett Newbie

      Hi all,

       

      I'm in the process of integrating the Guvnor backend with our custom frontend and have run into a problem creating a new asset. The following call to the REST API successfully manages to create a BPMN2 asset:

       

      POST http://10.4.4.10:8080/drools-guvnor/rest/packages/defaultPackage/assets HTTP/1.1

      Content-Type: application/atom+xml

      Accept: application/atom+xml

      Authorization: Basic {Base64 encrypted credentials}

       

      <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">

      <atom:title>TestAsset</atom:title>

      <atom:summary>This is a test asset</atom:summary>

      <metadata>

      <format><value>bpmn2</value></format>

      </metadata>

      </atom:entry>

       

      However, the server fails to capture the username from the authorization credentials and instead returns a blank author field:

       

      HTTP/1.1 200 OK

      Server: Apache-Coyote/1.1

      Set-Cookie: JSESSIONID=ujncnWuRCq5v-5mmnfWmBGda.undefined; Path=/drools-guvnor

      Content-Type: application/atom+xml

      Content-Length: 973

      Date: Mon, 24 Jun 2013 20:30:25 GMT

       

      <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xml:base="http://10.4.4.10:8080/drools-guvnor/rest/packages/defaultPackage/assets/TestAsset">

      <atom:title>TestAsset</atom:title>

      <atom:id>http://10.4.4.10:8080/drools-guvnor/rest/packages/defaultPackage/assets/TestAsset</atom:id>

      <atom:published>2013-06-24T15:51:23.313-07:00</atom:published>

      <atom:author><atom:name /></atom:author>

      <atom:content type="application/octet-stream" src="http://10.4.4.10:8080/drools-guvnor/rest/packages/defaultPackage/assets/TestAsset/binary" />

      <atom:summary>This is a test asset</atom:summary>

      <metadata>

      <uuid><value>cd89392a-2cb7-46c8-b4f9-b0630502a546</value></uuid>

      <categories />

      <format><value>bpmn2</value></format>

      <state><value>Draft</value></state>

      <versionNumber><value>0</value></versionNumber>

      <checkinComment><value>Initial</value></checkinComment>

      <archived><value>false</value></archived>

      </metadata>

      </atom:entry>

       

      Does anyone have an idea of where I'm going wrong, or perhaps a hint as to where I should start looking in the source code?

       

      Thank you,

      Shane