...
Code Block |
---|
|
for (String key : rowKeys) {
System.out.println("Record key is " + key);
} |
Use as Datalist Formatter
Note:
- The entire script is defaulted to be applied to every row in the specified column, hence it is not needed to perform looping to manually apply formatting to every row.
- It is also possible to use hash variables in the returned value.
Injected Variables:
- datalist - Datalist object of the current datalist (org.joget.apps.datalist.model.Datalist)
- column - The current datalist column object (org.joget.apps.datalist.model.DataListColumn)
- row - row Object of current record row in the datalist.
To retrieve the property value from Object row, use this service method: DataListService.evaluateColumnValueFromRow(Object row, String propertyName)
- value - value of the current row as String
Expected Return Object:
- A String value to replace the original row value
Samples:
Example code using DataListService service method to evaluate column value "Name" from row object.
Code Block |
---|
|
//import the necessary classes
import org.joget.apps.datalist.service.DataListService;
import org.joget.apps.app.service.AppUtil;
DataListService dataListService = (DataListService) AppUtil.getApplicationContext().getBean("dataListService");
//since this entire bean shell applies to every row, "row" is automatically iterated here.
//"name" is the column id
return dataListService.evaluateColumnValueFromRow(row, "name"); |
Use as Process Participant
Injected Variables:
- pluginManager - Plugin Manager service bean for convenient usage. (org.joget.plugin.base.PluginManager)
- workflowActivity - Workflow Activity that trying to retrieves assignee. (org.joget.workflow.model.WorkflowActivity)
Expected Return Object:
- A java.util.Collection of username in java.lang.String to be assign to the Workflow Activity.
Samples:
Randomly assign an user in a department to a workflow activity.
...
Use as Process Tool
Anchor |
---|
| Use as Process Tool |
---|
| Use as Process Tool |
---|
|
Injected Variables:
- workflowAssignment - The workflow tool activity assignment object. (org.joget.workflow.model.WorkflowAssignment)
- pluginManager - Plugin Manager service bean for convenient usage. (org.joget.plugin.base.PluginManager)
- appDef - App definition of the process. (org.joget.apps.app.model.AppDefinition)
- request - Http Request object of current HTTP Request. Not available if the tool is trigger by Deadline. (javax.servlet.http.HttpServletRequest)
Expected Return Object:
Samples:
Start a new process in the same app with current record id.
...
Use as Userview Permission
Injected Variables:
- user - User object of current logged in user (org.joget.directory.model.User)
- requestParams - Request parameters map of current HTTP Request (java.util.Map)
Expected Return Object:
- A boolean value to indicate the user is authorized.
Samples:
Check the user is in a group and is an admin user.
...