cancel
Showing results for 
Search instead for 
Did you mean: 

Get completed workflows for a node

dave984
Champ in-the-making
Champ in-the-making
Hi all, starting from a previous post, i'm asking if there is a way to have in the document-details page of a document the information not only about the active workflow but also the completed.
So i started studying the panel 'Workflows' and the webscripts invoked, that is document-workflows.
In document-workflows.get.js i found the remote call that retrieve all the active workflows:   

var result = remote.call("/api/node/" + nodeRef.replace(":/", "") + "/workflow-instances");


Finally the question is: is there a way to retrieve the completed workflows for a defined node? i don't think i can add something in query string to that service…
2 REPLIES 2

s_palyukh
Star Contributor
Star Contributor
HI,

I don't know any default webscript to get completed workflows for a node, but you can make your own java based webscript to do it. Take a look at WorkflowService class and method getWorkflowsForContent.


    /**
     * Gets the Workflows that act upon the specified Repository content.
     * 
     * @param packageItem  the repository content item to get workflows for
     * @param active  true => active workflows only, false => completed workflows only
     * @return  list of workflows which act upon the specified content
     */
    @Auditable(parameters = {"packageItem", "active"})
    public List<WorkflowInstance> getWorkflowsForContent(NodeRef packageItem, boolean active);


dave984
Champ in-the-making
Champ in-the-making
exactly what i need!!
Thanks!