[version: Alfresco Community 5.2]
I need to create functionality, which removes all active workflow instances but only for specified workflow definition.
For instance, document may be a part of many diffrent workflows, e.g. "New Task", "Review and Approve" and so on. More, there may be lot of instances of each workflows active at the same time. I'd like to remove all instances of "Review and Approve" workflow but left "New Task" still active.
You can create a webscript and check whether the workflows which are running on particular node.
private static final String[] ENABLE_WORKFLOW_LIST = {"New Task"};
List<WorkflowInstance> workflowInstanceList = workflowService.getWorkflowsForContent(nodeRef, true);
for (WorkflowInstance workflowInstance : workflowInstanceList) {//Make check for workflow something like below
if (!Arrays.asList(WORKFLOW_LIST).contains(workflowInstance.getDefinition().getTitle())) {
//Perform the action which you want to do
}
}
If you dont know how to create webscript you can refer below link for more details.
Thanks. I did it exactly like that. I just was wondering if there is some simpler method that does not require coding.
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.