Mapping List in Output Parameter


I need to pass a list to the process instance when completing a task. The same list will be used in next multi-instance node to loop through. What is the best way to do it??

Thanks & Regards,
Devakumar J

Can you provide a picture of the BPMN?

Hi @Devakumar_Jayaraman,

there are many ways to achieve it. For instance you could set a list of ID’s into a variable and fetch executions corresponding to it later on in the process.

Does that help you?

I assume the type of ‘a task’ is userTask? In that case, you can submit an ArrayList as follows;

<script cam-script type="text/form-script">
        var variableManager = camForm.variableManager;

        camForm.on('submit', function (evt) {
			    name: 'myNewList',
			    type: 'Object',
			    value: $scope.selectedObjects,
			    valueInfo: {
			      serializationDataFormat: 'application/json',
			      objectTypeName: 'java.util.ArrayList<com.mycompany.myapp.MyDto>'
1 Like


Attaching the bpmn here. accountList is the output of Get Local Accounts which i am usingto loop next multi-instance sub process. I am passing the list when i call signal method to complete the task Get Local Accounts. But this leads to List inside List.

Please provide any suggestion to map the output list in better way

Hi Askar,

Please provide your input based on the process attached here.

Thanks & regards,
Devakumar J

@Devakumar_Jayaraman The list you are generating for ‘Get Local Accounts’, is correctly passed into the “For Each Account” Sub-Process?

Where is the list in a list being generated in your BPMN picture?

Hi @StephenOTT,

Its not passed propery. I tried in this way but it generated list inside list. So multi instance was not created properly. Is this the correct way to pass list as part of output parameter??

Thanks & Regards,
Devakumar J

I would use a script to process your task variable in your output parameter. Look at this forum thread for a example of passing a array into the collection for the multi-instance sub-process: