0 Replies Latest reply on Apr 6, 2018 11:22 AM by christyl

    REST API dcuments

    christyl

      Hi,

       

      can someone please clarify some questions using REST api about documents I'm not able to resolve?

       

      Wildfly: 10.1

       

      First i would like to upload documents.

       

      POST: http://localhost:8080/kie-server/services/rest/server/documents

       

      {"document-id": "a195ce5e-e023-498d-887a-588435dbd44a",

      "document-name" : "document.pdf",

      "document-link" : "a195ce5e-e023-498d-887a-588435dbd44a",

      "document-content" : "JVBERi0xLjMKMyAwIG9iago8Qu="}

       

      The document will upload but I get an error 500 (Internal Server Error).

      Furthermore I notice that the id number is different. Why? and how can I define one?

       

       

      I would like to upload a document as a process variable

       

      PUT: http://localhost:8080/kie-server/services/rest/server/containers/HR_1.0/tasks/2/states/completed

      {"my_var":

      {"DocumentImpl" :

        {"identifier":"838da997-a496-4a5b-b0a2-eda1a35d7616",

         "name":"file.odt",

         "link":"838da997-a496-4a5b-b0a2-eda1a35d7616",

         "size": "xxxx",

         "lastModified": "",

         "content":"UEsDBB/vowDIwAACAAmZXN0LnhtbFBLBQYAAAAAEgASAJ8EAADkPAAAAAA="

         }}}

      This also ends up with an internal error because the documents will not be saved and my variable points to an empty spot and breaks my process. Same problem with the id number.

       

      The documentation is not very clear and also on http://localhost:8080/kie-server/docs I can't find any usefull information about documents. Can someone please give me a hint?

       

      Is it possible to define a process variable as a list of documents? I need to implement a process task gathering documents.