Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Cancel Workflows of all the provided Documents
Groovy Script - Cancel Workflows of all the provided Documents
Updated over a week ago

Description: Sample groovy script to cancel workflows of all the provided documents. Cancel workflow should not be run on current working workflow.

Context: Document

Remark: Accessible in 'Post' task mode only

Script:

def execute(){

String attributeName = "AppStatus";

String attributeValue = "Rejected";

String folderPath = "Asite Project\\Documents";

HashMap optionMap = new HashMap<>();

optionMap.put(RevisionDetailsOption.ALL_REVISION,true);

List<DocumentVO> documents = documentService.getDocsByCustomAttribute(attributeName, attributeValue, folderPath, optionMap);

documentService.cancelWorkflow(documents);

}



Did this answer your question?