Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Stop the Upload process if the Document Revision Number is not Numeric and Display a Message

Groovy Script - Stop the Upload process if the Document Revision Number is not Numeric and Display a Message

Updated over 3 weeks ago

Description: Sample Groovy script to stop the upload process if the document revision number is not numeric and displays a message.

Context: Document

Remark: Accessible in 'Pre' task mode only.

Script:

def execute(){

DocumentVO document = documentService.getDocumentDetails();

if (!document.getRevision().matches("[0-9]+")) {

document.setResponseStatus(false);

document.setResponseMessage("Revision should be numeric only.");

}

return document;

}



Did this answer your question?