Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Bean Shell plugin allows one to write custom Java code to achieve what other process tools may not.

Image Added

Figure 1: Bean Shell Properties

NameDescription
ScriptScript in Java. Please see Bean Shell Programming Guide for code example. 

 

 

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);

 

...