Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Validate combination of Purpose of Issue and Document Status
Groovy Script - Validate combination of Purpose of Issue and Document Status
Updated over a month ago

Description: Sample groovy script to validate combination of purpose of issue and document status

Context: Document

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?