AnsweredAssumed Answered

Alfresco Activiti Suite: attaching documents to task instances fail

Question asked by mikeblum on Jul 10, 2015

I'm working on an integration for the Alfresco Activiti Suite that attaches a document to the process instance and associated task. As per the 1.2 and 1.3 documentation, I should be able to attach a file to a task like this:

To upload content to a task:

POST api/enterprise/process-instances/{taskId}/raw-content
where the body contains a multipart file.

To relate content (eg from Alfresco) to a process instance:

POST api/enterprise/process-instances/{processInstanceId}/content

I'm getting the following exception from the Activiti engine:

17054 [http-nio-8090-exec-2] INFO  - Uploading content to task 32743 on process instance 32734
17054 [http-nio-8090-exec-2] INFO  - Uploading content to task instance: http://localhost:8080/activiti-app/api/enterprise/process-instances/32743/raw-content
17080 [http-nio-8090-exec-2] ERROR  - 404: Failed to attach workflow doc to 32743
17081 [http-nio-8090-exec-2] ERROR  - Not Found
17081 [http-nio-8090-exec-2] ERROR  - {"message":"Process instance not found for id 32743","messageKey":"GENERAL.ERROR.NOT-FOUND"}
17081 [http-nio-8090-exec-2] ERROR  - Failed to start process instance: 32734

I can successfully upload raw-content to the parent process instance but not the task itself.  I discoved these endpoints exist:

POST api/enterprise/tasks/${instanceId}/raw-content
POST api/enterprise/tasks/${instanceId}/content

respectively but there doesn't appear to be any documentation on it in the 1.2 or 1.3 docs. I looks like trying to attach a document to a task using the /process-instances endpoint is failing and when I tried the above endpoints, I see the content added to the parent process-instance instead when I checked it out in the activiti-app.

Any guidance would be much appreciated.


Technology Services Group