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?
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.
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.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.