You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Increment a workflow variable value:

 

import org.joget.workflow.model.service.WorkflowManager;
 
WorkflowManager workflowManager = (WorkflowManager) pluginManager.getBean("workflowManager");
String approvalLvl = workflowManager.getProcessVariable(workflowAssignment.getProcessId(), "ApprovalLevel");
String newApprovalLvl = String.valueOf(Integer.parseInt(approvalLvl)+1);
workflowManager.activityVariable(workflowAssignment.getActivityId(), "ApprovalLevel", newApprovalLvl);

 

This beanshell script retrieves workflow variable 'ApprovalLevel', converts it to an integer, adds 1, and stores it back as the same workflow variable.

  • No labels