cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the document status with Javascript application or CMIS.

rmartins01
Champ in-the-making
Champ in-the-making

Hi, how can I get the document status with Javascript application or CMIS. I mean if it was approved or rejected in WF.

3 REPLIES 3

douglascrp
World-Class Innovator
World-Class Innovator

Hello.

First of all, the out of the box workflows do not "mark" documents as approved or reject.

If you need workflows to do so, you have to create your own templates, and include the code to do so.

Second, if you want to "check", you can simply read the property, that you will also have to create, something like custom:docStatus.

kaynezhang
World-Class Innovator
World-Class Innovator

   By default ,an node only save the workflow instances information(maybe many instances) in it's workflowPackage aspect or it's parent's workflowPackage aspect。By querying workflow instance information ,you can get all task instances belong to this instance. Then you may query approve information from task variable.
   So you can't get this information by using CMIS.

   As for repository javascript ,it may work,but it is very complex.


I think you can try to modify workflow definition ,when the document is approved add an aspect to your node or set your custom property status to approve as C. R. Paes suggested.

Then you can query using cmis or javascript.

cesarista
World-Class Innovator
World-Class Innovator

Hi: 

The commented document-oriented and "cmisable" aprox. for custom:docStatus has many benefits in Alfresco Share (coming from a workflow or not), because you can include the document status (usually it is a contraint list of values) as a facet, obtaining a nice filter in Alfresco search (for example querying ASPECT:"custom:stastusable" or any other search). Also, you can make custom simple filters for status with Smart Folders too. Even you can include the status queries in dashlets or document library filters. Also custom indicators for the status and metadata templates in the document library may give you additional information while browsing the document library.

Regards.

--C.