Joget DX Preview Release Available for Download
Check out Joget DX, the next generation successor to Joget Workflow for faster, simpler digital transformation.
BeanShell is a small, embeddable Java source interpreter with object scripting language features written in Java. BeanShell dynamically executes standard Java syntax. So, by using BeanShell Plugin, you can type in valid Java codes in plugin configuration and the statements will be executed when the plugin is triggered. No compilation cycle is needed.
The script can be composed of:
Set value to a workflow variable:
Execute SQL statement through JDBC:
A participant type plugin should return a collection of usernames. In the participant plugin, there are two context variables available for the script to use :
A Beanshell participant type plugin returning one participant:
Get all users from the DirectoryManager and assigning them:
Activity Tool Type Plugin is a plugin that will be executed when the workflow reaches a System Tool activity. System Tool activities must be placed in the workflow diagram and the Beanshell plugin configured in the Process's Activity Mapping for this to work. In this plugin, there are two context variables available for the script to use :
This beanshell script retrieves workflow variable 'ApprovalLevel', converts it to an integer, adds 1, and stores it back as the same workflow variable.