submit multiple forms from a dataList

Confluence User - 08 Jan, 2018

hi everyone,

i have a data list with multiple data records, there is a hyperlink in front of each data list record. if we click on that hyperlink, it takes us to the Pre-filled form of the specific record and we can submit that form from there and a process starts.

now what i want is that i check data records like this

and click only one button at the bottom of data list and it submits all the forms with respective data records. how can i do that?

forms;datalists

3


08 Jan, 2018
confluenceUser
1
confluenceUser

Hi

You can write a custom plugin to perform the above, tips and pointers are at Datalist Action Plugin .

The Joget Marketplace has a JJDBC Datalist Action Plugin but it is not designed for run process.


08 Jan, 2018
confluenceUser
confluenceUser

how can i start a process within datalist action plugin? can you provide me some sample code?

12 Jan, 2018
confluenceUser
confluenceUser

In Joget v6 you could use a beanshell datalist action and adapt the following beanshell process tool code:

Start a new process instance for each row of data loaded using foreign key and value

 

import org.joget.apps.form.model.FormRow;
import org.joget.apps.form.model.FormRowSet;
import org.joget.apps.app.service.AppUtil;
import org.joget.plugin.base.PluginManager;
import org.joget.apps.form.model.FormLoadBinder;
import org.joget.workflow.model.service.WorkflowManager;
 
    String formDefId = "ExpensesClaimEntry";  //change this to the form id used to load grid data
    String foreignKey = "claim"//change this to the foreign key field id
       
    // Reuse Multi Row Binder to load data
    PluginManager pluginManager = (PluginManager) AppUtil.getApplicationContext().getBean("pluginManager");
    WorkflowManager workflowManager = (WorkflowManager) AppUtil.getApplicationContext().getBean("workflowManager");
    FormLoadBinder binder = (FormLoadBinder) pluginManager.getPlugin("org.joget.plugin.enterprise.MultirowFormBinder");
      
    //Load from the grid table
    binder.setProperty("formDefId", formDefId);
    binder.setProperty("foreignKey", foreignKey);
     
    FormRowSet rows;
    rows = binder.load(null"#assignment.processId#"null);
     
    //loop through records returned
    for (FormRow row : rows) {
        try {
            Map variableMap = new HashMap();
            variableMap.put("status", row.getProperty("purpose"));
             
            //start a new process instance with data from each row
            //processStart(String processDefId, String processId, Map<String, String> variables, String startProcUsername, String parentProcessId, boolean startManually)
            workflowManager.processStart("expenseclaim:latest:process1"null, variableMap, null, row.getProperty("id"), false);
        catch (Exception e) {}
    }

 

 

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print