Skip to main content

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

Updated over 2 months 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?