Skip to main content

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

Description: Sample Groovy Script to stop the upload if the document revision number is not numeric and display a message.

Context: Document

Document Type: File

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?