I'm purging all unused content on old server Alfresco 5.1.
Now in Alfresco database is about 15 000 completed and active workflows associated with documents.
I would find out how to remove these workflows instances.
I tried to use standard command in workflow console,
delete all workflows imeanit
but it doesn't work (it runs very slowly and with errors). I can check count of workflow instances in Activity Explorer.
Also I tried to use some ready JS scripts. For example, one of them:
var workflowDefinitions = workflow.getAllDefinitions(); for (i in workflowDefinitions) { var workflowDefinition = workflowDefinitions[i] logger.error("Def:" + workflowDefinition.id); var workflowInstances = workflowDefinition.activeInstances; for (j in workflowInstances) { wfInst = workflowInstances[j]; logger.error(" Inst:" + wfInst.id); wfInst['delete'](); } } }
Unfortanly, it doesn't work for me too.
I know that modifying Alfresco sql db directly is not so good way.
However, I have question, is is possible to remove all workflows by deleted required entries (activiti) in sql database?
Hi,
I think it is possible to remove all workflows from database but I am not sure about it.
Instead of removing workflows from database, you can create custom webscript to remove all workflows using WorkflowService.
Thanks,
Vidhi
Hello,
Yes you can remove all workflows by deleting data in specific tables. Those tables are which start by "act_hi" and "act_ru".
Note: I had the same issue, when I try to remove much workflow instances, 15 000 in your example. So I gave a limit number 300 or 400 for example and it works fine.
I hope that my solution helps some.
Best regards.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.