Versions Compared

Key

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

...

    • Same org.joget.apps.form.model.FormRowSet object which stored.

Samples:

Do some calculation before storing the data.

Code Block
languagejava
 

 

Use as Form Validator

...

    • An org.joget.apps.form.model.FormRowSet object which contains one or more org.joget.apps.form.model.FormRow object. 

Samples:

Load default grid data from another table if current record does not have any grid data.

Code Block
 

 

Use as Form Multi Row Store Binder

...

    • Same org.joget.apps.form.model.FormRowSet object which stored.

Samples:

Create users based on the grid data.

Code Block
 

 

Use as Form Multi Row Validator

...

    • A boolean value to indicate the validation pass or fail.

Samples:

Validate the sum of a column values are less than 1000.

Code Block
 

 

Use as Form Permission

...

Expected Return Object:

    • None

Samples:

Reuse Email tool to send separate email to each users.

Code Block
 

 

Use as Process Participant

...

        Randomly assign an user in a department to a workflow activity.

Code Block
languagejava
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);

...

Expected Return Object:

    • None

Samples:

 Start a new process in the same app with current record id.

Code Block
languagejava
 

 

Use as Userview Permission

...

    • A boolean value to indicate the user is authorized.

Samples:

Check the user is in a group and is an admin user.

Code Block
languagejava
 

 

Best Practices

...