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;
}
