cancel
Showing results for 
Search instead for 
Did you mean: 

Completed workflows for a document

prachi379
Champ on-the-rise
Champ on-the-rise
I would like to use the REST API to return the completed workflows for a document.

The following works for me, it returns ALL the completed workflows - http://localhost:8080/alfresco/s/api/workflow-instances?state=completed

But it will not work for specific document - http://localhost:8080/alfresco/s/api/node/workspace/SpacesStore/e3ebc28c-d100-4c1c-b488-2526fd8769e9...

I want to modify the API so that I can use the 'state=completed' filter for a specific document as well.

Is this possible and if yes, where is the code located? (I haven't found it so far..)

Thank you!!
2 REPLIES 2

prachi379
Champ on-the-rise
Champ on-the-rise
Further usecase information -

I want to create a new page which displays a list of ALL the workflows for the document. I would like to link this page to the workflows section in document details and have this page be visible to all users who have access to the document itself (and not just those who are a part of the workflow). I have been investigating and trying out ways to achieve this and the easiest way so far is to have the REST API work the way described above.

I wanted to know where the code for these services is located, if anyone has a clue please let me know!

Answering my own question for anyone else looking for a solution - I was able to achieve this by creating a new web script to return the active as well as completed workflows. I setup the alfresco dev environment in eclipse to implement the web script controller. The existing web scripts are in the jar file alfresco-remote-api-5.0.a.jar and if you see the implementation of workflow-instances-for-node, things will be more clear.

I then used this web script in a page that looks similar to 'my-workflows' and linked to this page in document details.