Collection process variables

Hi everone,
Can anyone explain what is collection process variable and how its used or created . I have come across this term while working with multi instance activity (section : 8.5.15) . I am totally confused as to what the document is conveying there. Any help would be appreciated :slight_smile:

Thanks in advance
Shweta

Hi Shweta.

check
org.flowable.engine.test.bpmn.multiinstance.MultiInstanceTest#testSequentialCallActivityWithList

in flowable source.

Regards
Martin

Hi Martin,
Flowable source as in on Github ? or in flowable doc ?

Thanks
shweta

Hi Martin,
I went through MultiInstanceTest.testSequentialCallActivityWithList.bpmn20.xml
But i still didn’t get what a collection does . Could you explain with examples or theory , as there is very little explanation for collection in document and i am not able to comprehend that.

Thanks :slight_smile:
shweta

Collection expression in multiinstance task does exactly the same as

for( collectionItem : collection) {
// original task behavior
}

for more info see https://github.com/flowable/flowable-engine/blob/70b54d6a670beb1cc12df3588536c8e30fcd3867/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/MultiInstanceActivityBehavior.java#L280

Martin