Skip to main content

Groovy Script - Validate the Combination of Purpose of Issue and Document Status

Description: Sample Groovy Script to validate the combination of Purpose of Issue and Document Status.

Context: Document

Document Type: File

Remark: Accessible in 'Pre' task mode only.

Script:

def execute(){
DocumentVO document = documentService.getDocumentDetails();
if (document.getPurposeOfIssue().equals("S4 - Issued for Construction") && ( document.getStatus().equals("WIP") || document.getStatus().equals("Work In Progress"))) {
document.setResponseStatus(false);
document.setResponseMessage("Invalid combination of POI and status to upload file in this folder.");
}
return document;
}
Did this answer your question?