Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
...
Do some calculation before storing the data.
Code Block | ||
---|---|---|
| ||
...
Load default grid data from another table if current record does not have any grid data.
Code Block |
---|
...
Create users based on the grid data.
Code Block |
---|
...
Validate the sum of a column values are less than 1000.
Code Block |
---|
...
Reuse Email tool to send separate email to each users.
Code Block |
---|
...
Randomly assign an user in a department to a workflow activity.
Code Block | ||
---|---|---|
| ||
import java.util.ArrayList; import java.util.Collection; import org.joget.apps.app.service.AppUtil; import org.joget.directory.model.User; import org.joget.directory.model.service.ExtDirectoryManager; import org.joget.workflow.model.WorkflowActivity; public Collection getAssignees(WorkflowActivity activity) { Collection assignees = new ArrayList(); ExtDirectoryManager directoryManager = (ExtDirectoryManager) pluginManager.getBean("directoryManager"); String deptId = "D-005"; //Get total user in department Long total = directoryManager.getTotalUsers(null, null, deptId, null, null, null, null); //Get random number from 0 to the total number of users in department int random = (int) (Math.random() * total); //Get users using directory manager Collection userList = directoryManager.getUsers(null, null, deptId, null, null, null, null, "firstName", false, random, 1); for(Object u : userList){ User user = (User) u; assignees.add(user.getUsername()); } return assignees; } //call getAssignees method with injected variable return getAssignees(workflowActivity); |
...
Start a new process in the same app with current record id.
Code Block | ||
---|---|---|
| ||
...
Check the user is in a group and is an admin user.
Code Block | ||
---|---|---|
| ||
...