Alfresco support JBPM workflows to leverage and streamline business processes. It will increase the security, reduce paper work, allow quick turnaround time, and many more advantages. So, for any organization which is using Alfresco for storing their content, they should take advantage of Alfresco workflows to implement business processes in it.
In WCM module of alfresco workflows are used as part of publishing process where content goes through various approval before final approval so that proofing and other correction and require approval could be embedded as part of workflow.Sometimes we have a situation where after creating many instances of workflows it seems stuck/stranded and we cannot deploy content, How to remove/delete WCM/AVM workflows? Stranded workflow can be caused by a number of reasons to include: deleting a user from Alfresco without first removing user from all web projects they are assigned to and without ending all the workflows they started or are tasked on; using “delete” workflow instead of “end” workflow will strand a WCM/AVM workflow; any disruption in workflow such as system crash.
Workflow stores will temporarily be shown in the Alfresco UI
(/alfresco)> “Admin Console” > “Node Browser” list while workflow is running.
They have the format “avm://<storename>–workflow-<workflowsid>”.
- Take a full “cold” backup of your repository before trying this.
- Test this in a test environment before implementing it on production.
- Deletion of stores incorrectly or incorrect ones can permanently disable your web project and repository.
This is how we could solve above issue.
Try to properly end workflows with the workflow console:
As ‘admin’ user
- login to the workflow console
Step2: list all workflows entering command
show workflows all
Last command: show workflows all
id: jbpm$8 , desc: initial file uploads , start date: 2013-11-27 16:17:9.0 , def: jbpm$wcmwf:submit v1
id: jbpm$9 , desc: deploy something , start date: 2013-13-11 13:14:29.0 , def: jbpm$wcmwf:submit v1
end each workflow using command
end workflow <workflowid>
end workflow jbpm$8
- check workflows are no longer with “show workflows all”
- check the Alfresco UI > “Admin Console” >”Node Browser”” see if all workflow nodes are gone
If, there workflows will not “end” and the workflow stores are still stranded in the node browser then you will need to:
Alternate Workaround steps(Specific to WCM only)
- Delete the sandboxes/stores using AVM console
- Delete the workflows using workflow console
- Restart Alfresco
Using the list of workflow sandboxes/stores from the “Node Browser” as reference:
ex (list of “Node Browser” workflow stores).
- log in to “AVM console”
- remove stranded workflow nodes, execute
- Using the “Node Browser” click on the “refresh view” link in the top left corner to confirm the workflow store was removed
- repeat removal for all workflow stores listed in the “Node Browser” with the “AVM console”
- validate using the “workflow console” and “show workflows all” command if there are any workflows remaining
- If all the workflow stores are removed from the “AVM console” and you still have workflows listed in the “workflow console”, use the delete command in “workflow console” to remove the remaining workflows
delete workflow <workflowid>
delete workflow jbpm$8
- repeat delete for each workflow to be deleted
- Check all workflows gone (using the workflow console list all workflows)
- Check all workflow stores gone (Using the node browser validate that the workflow stores are no longer listed)
- restart Alfresco application server
For deleting workflow on normal Document Management module you can follow initial step 1 to 3.
We also need to take care once workflow is in production disable the new version of workflow by putting redeploy as false as shown below
These are few tips of JBPM workflow administration for alfresco system especially these tips will be helpful in system which are into production. Fell free to comment for any of your questions.