07-17-2018 04:00 PM
After generating a document with a Generate Document task, and I need to retrieve the raw document afterwards. I know I can do this with the endpoint: /enterprise/content/{contentId}/raw endpoint, so I have a Script task following the generate document task that calls this endpoint. I keep getting a 404 not found error when the process is run, but the document is successfully retrieved when that same url is called after the process that generated the document is done. I tried generating the document in a subprocess (see the attached pictures) to see if the document would be available once the subprocess is done, but I got the same results. I also tried splitting up the processes into two separate processes, one to generate the document and the other to retrieve the data. Then I called the second process from an execution listener that gets triggered when the first process (the document generation) is completed, but I'm still getting the same results.
This leads me to ask the following question: are generated documents not able to be retrieved through the api until the entire process that the document was generated in has been completed?
08-01-2018 10:28 AM
It's probably an issue it timing. The generated document task runs asynchronously. So it might have not fully stored the document at the time you called it. Try adding a timer before the script task that will pause for few seconds.
08-02-2018 08:06 AM
Apparently I just needed to check the "Async" checkbox in the script task, then the document generated asynchronously in the generate document task was available to be retrieved.
Explore our Alfresco products with the links below. Use labels to filter content by product module.