start case in groovy
This is what we do...
String processToStart = "the Process I want to Start";
String latestVersion = "1.0"; //make sure this is the right format for your numbers - we found 1.00 is not the same as 1.0
long processId;
processId = processAPI.getProcessDefinitionId(processToStart, latestVersion);
//Start the process with a Map of Data that will be used in the newly started process
Map<String, Serializable> processData1 = new HashMap<String, Serializable>();
processData1.put("mergedAssignmentData", mergedAssignmentData1.toString());
processData1.put("whoIsTheSender", initiatorUserName.toString());
processData1.put("additionalText", chosenStepAdditionalText.toString());
ProcessInstance processInstance1 = processAPI.startProcess(processId, processData1);
regards
Seán
PS: As this reply answers your question, please mark as resolved by ticking the tick mark on the left of this reply.
In groovy you have an easy access to whole engineApi, and the processApi is probably what you need to use.
But there is also another option. In the script you can prepare data that will be used to start process and save it into some variable (for example a map or list of maps if you plan to start more than one instance). Then in 'call activity' or 'send message' task you can start that process.
Best regards,
bpms.help
Comments
look like its bugged.
A Tip on displaying CODE/LOGS correctly in Posts:
Do not use the Supplied Buttons above, for some reason they refuse to work correctly, and despite bringing it to Bonitasofts attention, it's low priority.
To Show Code/Logs correctly use
< code >
your code/log
< /code >
removing the spaces to allow the showing of code/logs correctly as here:
Thanks and regards
Seán