Hi,
There are multiple parts to this problem:
- First, we want to split a single string into a list of strings
- We want to use a multi-instance subprocess to iterate over this list.
For each task, we can define input and output mappings. To calculate local input variables and global outputs. A common use case are simple data transformations. In your case, I recommend adding an output definition to the user task “NUMBER OF INSTANCE”. This output mapping does the following:
- It takes the string input
sitesInjectes - Splits it at the deliminator “-” and thereby creates an array
- It transforms the array into an ArrayList
- It creates a new process variable
arrayKeysthat holds this list
In groovy, the script would look something like this:
// Split the string into an array
arrayKeys = sitesInjectes.split("-");
// Create an Array list
listKeys = new ArrayList();
// Add the elements to the list
for (key in arrayKeys) {
listKeys.add(key);
}
listKeys
In detail, add the following configuration to your task:
Next, we need to configure your multi-instance subprocess so that it iterates over the keys in the variable listKeys. The following configuration creates an instance for each key in listKeys. The key can be accessed via the variable key:
You may also check out the newest features in Camunda 7.18 and the modeler 5.4.1. There you have a new input element, called taglist, to enter a list of strings.

