10-22-2019 09:51 AM
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?
10-23-2019 01:28 AM
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
06-04-2020 06:34 AM
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.
Explore our Alfresco products with the links below. Use labels to filter content by product module.