Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Validate the Combination of Purpose of Issue and Document Status

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

Updated over 3 weeks ago

Description: Sample Groovy script to validate the 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?