Issue Passing Data from Parent to Child Process via BeanShell (Multiple Processes)
Confluence User - 10 Feb, 2025
I am implementing a workflow where multiple child processes need to be started dynamically from a parent process using BeanShell scripting. Since we need to start multiple process instances, we are using the processStart method instead of relying on form-based initiation. However, we are facing an issue where the child process starts successfully, but the form mapped at the start point remains empty, even though we are passing variables correctly via variableMap.
Implementation Details:
We referred to the following example from Joget’s documentation:
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);
This is our implementation:
Map variableMap = new HashMap();
variableMap.put("annual_plan_title", rs.getString("id"));
variableMap.put("annual_plan_id", rs.getString("id"));
// Start a new process for each row
workflowManager.processStart("Omancpa:29:price_ob_child", null, variableMap, null, processId, false);
Issue:
- The child process starts, but the form data remains empty.
- The form is mapped at the start point, and the IDs being passed match.
- Despite passing variables through
variableMap, the child process does not receive the expected data. - We need to ensure that multiple child processes start correctly with the necessary form data.
Questions:
- What is the correct way to pass form data when starting a process via BeanShell?
- Is there any additional configuration required for the child process to accept variables?
- Are there any known limitations or alternative methods to ensure that multiple child processes receive the required data?
Looking forward to your responses.
process;beanshell;mulltiprocess