cancel
Showing results for 
Search instead for 
Did you mean: 

Closed workflow history related with document

djarty
Star Contributor
Star Contributor

Hello!

Have site and document library with docs in it.

Some workflow (one per doc) starting with some doc.

We can see icon in doclist - this doc is under workflow - good.

Workflow ending and closed. 

Now we see just "clean" doc like no workflows was already done.

So, need too see in doclib - this document already was under workflow and workflow closed. Logically - possibility to quick see this closed worflow. 

I think it can be something like doc model property or aspect looking like link named "Done" with url to closed workflow.

How to realise this? Or may be another way to see - "some job under this doc was done". 

(Really strange why its not realised by default. Found some request under 10 years ago - and still nothing?)

Thank you!

4 REPLIES 4

jayesh_prajapat
Star Contributor
Star Contributor

Hi

You are right, Alfresco do not display list of completed workflow on specific document on document detail page. You may implement your own code to retrieve and display completed workflow using WorkflowService. Check getWorkflowsForContent method to get active or inactive workflow list for specific node,

    /**
     * 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);

Hm..  cant find info about getWorkflowsForContent in Alfresco Docs

"..implement your own code.." It looks like clear Java code.

But may be possible just use JavaScript and folder Rules e.g. for trying to copy/paste existing workflow url into special memo field of document (document model properties or aspect)?  

Or make flag property "Done" if process closed via the folder rule.

Hope folder rule "if document changed" - take affect if workflow for this doc was started.. (may be not.. dont know)

Or make special workflow rule - change doc property before workflow close ...

djarty
Star Contributor
Star Contributor

Can be useful :  Complete Workflow History Plugin