Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Set Document Version to dynamicADecisionVariable which can be used in Decision Gateway condition
Groovy Script - Set Document Version to dynamicADecisionVariable which can be used in Decision Gateway condition
Updated over a month ago

Description: Sample groovy script to set document version to dynamicADecisionVariable which can be used in decision gateway condition. Should be used along with workflow only

Context: Document

Remark: Accessible in 'Post' task mode only

Script:

def execute(){

DocumentVO document = documentService.getDocumentDetails();

String documentVersion = document.getVer();

List<ScriptResponseVO> responseActions = new ArrayList<ScriptResponseVO>();

ScriptResponseVO variableParamVo = new ScriptResponseVO();

variableParamVo.setResponseAction(ResponseActionEnum.UPDATE_WORKFLOW_VARIABLE);

Map<String, Object> variableParamMap = new HashMap<>();

variableParamMap.put(IGroovyConstant.DYNAMIC_ADECISION_VARIABLE, documentVersion); // You can set any value between 1 to 99 to this variable

variableParamVo.setResponseObject(variableParamMap);

responseActions.add(variableParamVo);

return responseActions;

}



Did this answer your question?