Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get a list of workflows the document is attached to in Alfresco

I'm trying to get a list of workflows the document is attached to in an Alfresco webscript, but I am kind of stuck.

My original problem is that I have a list of files, and the current user may have workflows assigned to him with these documents. So, now I want to create a webscript that will look in a folder, take all the documents there, and assemble a list of documents together with task references, if there are any for the current user.

I know about the "workflow" object that gives me the list of workflows for the current user, but this is not a solution for my problem.

So, can I get a list of workflows a specific document is attached to?

like image 736
Zlatko Avatar asked Dec 13 '22 20:12

Zlatko


1 Answers

Well, for future reference, I've found a way to get all the active workflows on a document from javascript:

var nodeR = search.findNode('workspace://SpacesStore/'+doc.nodeRef);
    for each ( wf in nodeR.activeWorkflows )
    { 
        // Do whatever here.
    }
like image 173
Zlatko Avatar answered Apr 12 '23 23:04

Zlatko