how to test value of workflow variable A (mgrApproval) in below script & set new value to workflow variable B (requestStatus) based on value of A.
Confluence User - 05 Jan, 2017
import org.joget.workflow.model.service.*;
WorkflowManager wm = (WorkflowManager) pluginManager.getBean("workflowManager");
//store the value of workflow variable mgrApproval in String variable test1
String test1 = wm.getProcessVariable(workflowAssignment.getProcessId(), "mgrApproval");
//check if mgrApproval is set to rejected & set requestStatus to Rejected.
if (test1 == "Rejected"){
wm.activityVariable(workflowAssignment.getActivityId(), "requestStatus", "Rejected");
}
//else set requestStatus to In Progress
else
{
wm.activityVariable(workflowAssignment.getActivityId(), "requestStatus", "In Progress");
}
beanshell;forms;workflowmanager