How to display list of workflows of a document

cancel
Showing results for 
Search instead for 
Did you mean: 
hiten_rastogi1
Established Member

How to display list of workflows of a document

Hi,

I would like to know how I can display list of workflows that a document is a part of. For e.g. if a document was a part of workflow W1 which is now completed and a current workflow W2, I would like to show it to the users when they access the document this information.

Please suggest a way on how to achieve this.

Thanks

Hiten Rastogi

8 Replies
shagufta1
Member II

Re: How to display list of workflows of a document

Hi Hiten,

One way to achieve this is, content id you will have when you upload a document in any process. You can fetch the processInstanceId from that content Id. And that's what you need. Use that processInstanceId to fetch any details related process.

To Achieve this I am not aware that there is any java api is available or not. You can go through java api docs to find one. And other way could be you can fire a query on db by using Query Api.

Hope this helps.

Thanks,

Shagufta

yogeshpj
Established Member

Re: How to display list of workflows of a document

Use Alfresco OOTB workflow service API : WorkflowService (Alfresco 5.2-SNAPSHOT API) 

It is giving list of workflows started on document both active and completed based on boo-lean argument.

shagufta1
Member II

Re: How to display list of workflows of a document

Hey Yogesh,

It's great to know that there is api for that. Thanks for sharing.

Thanks,

Shagufta

hiten_rastogi1
Established Member

Re: How to display list of workflows of a document

For future reference.

I have used the below mentioned addon that fills my requirement. 

Complete Workflow History | Alfresco Add-ons - Alfresco Customizations 

rodrigerar
Member II

Re: How to display list of workflows of a document

Dear Hiten,

I have installed the "Complete Workflow History" addon following the Github instruction, but I don't see any icon or section for Workflow History functionality. Could you tell me how to access it? If you could attach a printscreen, that will be very help full for me.

Thanks in advance!

Gerardo Rodriguez

hiten_rastogi1
Established Member

Re: How to display list of workflows of a document

Hi Gerardo,

You should be able to see the action View All Workflow on documents after applying the share and repo amps.

I hope you are applying the amps correctly as I am still using this amp in my production server and it is working fine.

rodrigerar
Member II

Re: How to display list of workflows of a document

Hi Hiten,

Thank you very much for your quickly response!
Looking a little more deeply, I discovered that the amps applying is failing. The output of the /opt/alfresco-community/bin/apply_amps.sh command shows:

[root@aws-alfresco-restore bin]# ./apply_amps.sh

Found java executable in /opt/alfresco-community/java

This script will apply all the AMPs in amps and amps_share to the alfresco.war and share.war files in /opt/alfresco-community/tomcat/webapps
Press control-c to stop this script . . .
Press any other key to continue . . .

java.io.FileNotFoundException: /opt/alfresco-community/amps/completewfhistory-repo.amp/module.properties
at de.schlichtherle.truezip.file.TFileInputStream.newInputStream(TFileInputStream.java:108)
at de.schlichtherle.truezip.file.TFileInputStream.<init>(TFileInputStream.java:81)
at org.alfresco.repo.module.tool.ModuleDetailsHelper.createModuleDetailsFromPropertyLocation(ModuleDetailsHelper.java:105)
at org.alfresco.repo.module.tool.ModuleManagementTool.installModule(ModuleManagementTool.java:229)
at org.alfresco.repo.module.tool.ModuleManagementTool.installModules(ModuleManagementTool.java:172)
at org.alfresco.repo.module.tool.ModuleManagementTool.installModules(ModuleManagementTool.java:155)
at org.alfresco.repo.module.tool.ModuleManagementTool.main(ModuleManagementTool.java:837)
Caused by: java.util.zip.ZipException: Expected Local File Header or (ZIP64) End Of Central Directory Record!
at de.schlichtherle.truezip.zip.RawZipFile.checkZipFileSignature(RawZipFile.java:179)
at de.schlichtherle.truezip.zip.RawZipFile.<init>(RawZipFile.java:148)
at de.schlichtherle.truezip.zip.RawZipFile.<init>(RawZipFile.java:129)
at de.schlichtherle.truezip.fs.archive.zip.ZipInputShop.<init>(ZipInputShop.java:45)
at de.schlichtherle.truezip.fs.archive.zip.ZipDriver.newInputShop(ZipDriver.java:498)
at de.schlichtherle.truezip.fs.archive.zip.ZipDriver.newInputShop(ZipDriver.java:481)
at de.schlichtherle.truezip.fs.FsTargetArchiveController.mount0(FsTargetArchiveController.java:197)
at de.schlichtherle.truezip.fs.FsTargetArchiveController.mount(FsTargetArchiveController.java:155)
at de.schlichtherle.truezip.fs.FsFileSystemArchiveController$ResetFileSystem.autoMount(FsFileSystemArchiveController.java:85)
at de.schlichtherle.truezip.fs.FsFileSystemArchiveController.autoMount(FsFileSystemArchiveController.java:37)
at de.schlichtherle.truezip.fs.FsBasicArchiveController.autoMount(FsBasicArchiveController.java:113)
at de.schlichtherle.truezip.fs.FsBasicArchiveController$1Input.getLocalTarget(FsBasicArchiveController.java:185)
at de.schlichtherle.truezip.fs.FsBasicArchiveController$1Input.getDelegate(FsBasicArchiveController.java:200)
at de.schlichtherle.truezip.socket.DelegatingInputSocket.getBoundSocket(DelegatingInputSocket.java:43)
at de.schlichtherle.truezip.socket.DelegatingInputSocket.newInputStream(DelegatingInputSocket.java:63)
at de.schlichtherle.truezip.fs.FsContextController$Input.newInputStream(FsContextController.java:273)
at de.schlichtherle.truezip.fs.FsResourceController$Input.newInputStream(FsResourceController.java:252)
at de.schlichtherle.truezip.socket.DelegatingInputSocket.newInputStream(DelegatingInputSocket.java:63)
at de.schlichtherle.truezip.fs.FsSyncController$Input.newInputStream(FsSyncController.java:400)
at de.schlichtherle.truezip.fs.FsLockController$Input$1NewInputStream.call(FsLockController.java:455)
at de.schlichtherle.truezip.fs.FsLockController$Input$1NewInputStream.call(FsLockController.java:452)
at de.schlichtherle.truezip.fs.FsLockController.locked(FsLockController.java:328)
at de.schlichtherle.truezip.fs.FsLockController.writeLocked(FsLockController.java:268)
at de.schlichtherle.truezip.fs.FsLockController$Input.newInputStream(FsLockController.java:459)
at de.schlichtherle.truezip.fs.FsFinalizeController$Input.newInputStream(FsFinalizeController.java:177)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$1Input$NewInputStream.call(FsFalsePositiveArchiveController.java:333)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$1Input$NewInputStream.call(FsFalsePositiveArchiveController.java:326)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$TryChild.call(FsFalsePositiveArchiveController.java:507)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController.call(FsFalsePositiveArchiveController.java:104)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$1Input.newInputStream(FsFalsePositiveArchiveController.java:323)
at de.schlichtherle.truezip.file.TFileInputStream.newInputStream(TFileInputStream.java:104)
... 6 more
Suppressed: java.nio.file.FileSystemException: /opt/alfresco-community/amps/completewfhistory-repo.amp/module.properties: Not a directory
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at de.schlichtherle.truezip.fs.nio.file.FileInputSocket.newInputStream(FileInputSocket.java:51)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$1Input$NewInputStream.call(FsFalsePositiveArchiveController.java:333)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$1Input$NewInputStream.call(FsFalsePositiveArchiveController.java:326)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$UseParent.call(FsFalsePositiveArchiveController.java:524)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController.call(FsFalsePositiveArchiveController.java:107)
... 8 more
08280001 An error was encountered during deployment of the AMP into the WAR: 08280000 Unable to load module details from property file. File Not Found, /opt/alfresco-community/amps/completewfhistory-repo.amp/module.properties
Module 'org.alfresco.integrations.google.docs' installed in '/opt/alfresco-community/tomcat/webapps/alfresco.war'
- Title: Alfresco / Google Docs Integration
- Version: 3.0.4
- Install Date: Fri Sep 28 10:54:50 ART 2018
- Description: The Repository side artifacts of the Alfresco / Google Docs Integration.
Module 'alfresco-aos-module' installed in '/opt/alfresco-community/tomcat/webapps/alfresco.war'
- Title: Alfresco Office Services Module
- Version: 1.1.6
- Install Date: Fri Sep 28 10:54:50 ART 2018
- Description: Allows applications that can talk to a SharePoint server to talk to your Alfresco installation
Module 'alfresco-share-services' installed in '/opt/alfresco-community/tomcat/webapps/alfresco.war'
- Title: Alfresco Share Services AMP
- Version: 5.2.0
- Install Date: Fri Sep 28 10:54:49 ART 2018
- Description: Module to be applied to alfresco.war, containing APIs for Alfresco Share
java.io.FileNotFoundException: /opt/alfresco-community/amps_share/completewfhistory-share.amp/module.properties
at de.schlichtherle.truezip.file.TFileInputStream.newInputStream(TFileInputStream.java:108)
at de.schlichtherle.truezip.file.TFileInputStream.<init>(TFileInputStream.java:81)
at org.alfresco.repo.module.tool.ModuleDetailsHelper.createModuleDetailsFromPropertyLocation(ModuleDetailsHelper.java:105)
at org.alfresco.repo.module.tool.ModuleManagementTool.installModule(ModuleManagementTool.java:229)
at org.alfresco.repo.module.tool.ModuleManagementTool.installModules(ModuleManagementTool.java:172)
at org.alfresco.repo.module.tool.ModuleManagementTool.installModules(ModuleManagementTool.java:155)
at org.alfresco.repo.module.tool.ModuleManagementTool.main(ModuleManagementTool.java:837)
Caused by: java.util.zip.ZipException: Expected Local File Header or (ZIP64) End Of Central Directory Record!
at de.schlichtherle.truezip.zip.RawZipFile.checkZipFileSignature(RawZipFile.java:179)
at de.schlichtherle.truezip.zip.RawZipFile.<init>(RawZipFile.java:148)
at de.schlichtherle.truezip.zip.RawZipFile.<init>(RawZipFile.java:129)
at de.schlichtherle.truezip.fs.archive.zip.ZipInputShop.<init>(ZipInputShop.java:45)
at de.schlichtherle.truezip.fs.archive.zip.ZipDriver.newInputShop(ZipDriver.java:498)
at de.schlichtherle.truezip.fs.archive.zip.ZipDriver.newInputShop(ZipDriver.java:481)
at de.schlichtherle.truezip.fs.FsTargetArchiveController.mount0(FsTargetArchiveController.java:197)
at de.schlichtherle.truezip.fs.FsTargetArchiveController.mount(FsTargetArchiveController.java:155)
at de.schlichtherle.truezip.fs.FsFileSystemArchiveController$ResetFileSystem.autoMount(FsFileSystemArchiveController.java:85)
at de.schlichtherle.truezip.fs.FsFileSystemArchiveController.autoMount(FsFileSystemArchiveController.java:37)
at de.schlichtherle.truezip.fs.FsBasicArchiveController.autoMount(FsBasicArchiveController.java:113)
at de.schlichtherle.truezip.fs.FsBasicArchiveController$1Input.getLocalTarget(FsBasicArchiveController.java:185)
at de.schlichtherle.truezip.fs.FsBasicArchiveController$1Input.getDelegate(FsBasicArchiveController.java:200)
at de.schlichtherle.truezip.socket.DelegatingInputSocket.getBoundSocket(DelegatingInputSocket.java:43)
at de.schlichtherle.truezip.socket.DelegatingInputSocket.newInputStream(DelegatingInputSocket.java:63)
at de.schlichtherle.truezip.fs.FsContextController$Input.newInputStream(FsContextController.java:273)
at de.schlichtherle.truezip.fs.FsResourceController$Input.newInputStream(FsResourceController.java:252)
at de.schlichtherle.truezip.socket.DelegatingInputSocket.newInputStream(DelegatingInputSocket.java:63)
at de.schlichtherle.truezip.fs.FsSyncController$Input.newInputStream(FsSyncController.java:400)
at de.schlichtherle.truezip.fs.FsLockController$Input$1NewInputStream.call(FsLockController.java:455)
at de.schlichtherle.truezip.fs.FsLockController$Input$1NewInputStream.call(FsLockController.java:452)
at de.schlichtherle.truezip.fs.FsLockController.locked(FsLockController.java:328)
at de.schlichtherle.truezip.fs.FsLockController.writeLocked(FsLockController.java:268)
at de.schlichtherle.truezip.fs.FsLockController$Input.newInputStream(FsLockController.java:459)
at de.schlichtherle.truezip.fs.FsFinalizeController$Input.newInputStream(FsFinalizeController.java:177)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$1Input$NewInputStream.call(FsFalsePositiveArchiveController.java:333)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$1Input$NewInputStream.call(FsFalsePositiveArchiveController.java:326)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$TryChild.call(FsFalsePositiveArchiveController.java:507)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController.call(FsFalsePositiveArchiveController.java:104)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$1Input.newInputStream(FsFalsePositiveArchiveController.java:323)
at de.schlichtherle.truezip.file.TFileInputStream.newInputStream(TFileInputStream.java:104)
... 6 more
Suppressed: java.nio.file.FileSystemException: /opt/alfresco-community/amps_share/completewfhistory-share.amp/module.properties: Not a directory
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at de.schlichtherle.truezip.fs.nio.file.FileInputSocket.newInputStream(FileInputSocket.java:51)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$1Input$NewInputStream.call(FsFalsePositiveArchiveController.java:333)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$1Input$NewInputStream.call(FsFalsePositiveArchiveController.java:326)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController$UseParent.call(FsFalsePositiveArchiveController.java:524)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController.call(FsFalsePositiveArchiveController.java:107)
... 8 more
08280001 An error was encountered during deployment of the AMP into the WAR: 08280000 Unable to load module details from property file. File Not Found, /opt/alfresco-community/amps_share/completewfhistory-share.amp/module.properties


Module 'org.alfresco.integrations.share.google.docs' installed in '/opt/alfresco-community/tomcat/webapps/share.war'
- Title: Alfresco / Google Docs Share Module
- Version: 3.0.4
- Install Date: Fri Sep 28 10:54:53 ART 2018
- Description: The Share side artifacts of the Alfresco / Google Docs Integration.
About to clean out /opt/alfresco-community/tomcat/webapps/alfresco and share directories and temporary files...
Press control-c to stop this script . . .
Press any other key to continue . . .

Cleaning temporary Alfresco files from Tomcat...

I'm following the steps described in the Github Project page:

https://github.com/aaditmajmudar/completeworkflowhistory

But I allways get the described error.
Any idea what I'm doing wrong?
Thank you in advance for your help!

Best Regards,

Gerardo Rodriguez

hiten_rastogi1
Established Member

Re: How to display list of workflows of a document

Hey,

Please try the below command.

/bin/apply_amps.sh -force -verbose

have a look at the below documentation

http://docs.alfresco.com/5.2/tasks/amp-install.html

Thanks

Hiten Rastogi

Sr. Software Engineer

Mobile: +91 9899586608

Email: hiten.rastogi@eisenvault.com

<https://eisenvault.com/>