How to get List<Long> from Map, for loop cardinaliy

Hello,
I need to retrieve from a context variable (such as Map<Long, ListLong) the ListLong to insert it as a loop cardinality of a subprocess, inside the bpmn. I should based on the Long (key) recover the selected ListLong within the map. I could not do this with the expression language in any way.

I need something like:
map.get(longIWantToTake);
in expression language, for retrive the ListLong to give to loop cardinality.

Can you help me?

Thanks a lot.

Using ${mapVar.get(1)} as the collection attribute seems to work for me.

You can also do something like this, where the subprocess uses ${mapVar.keySet()} as the collection with the element variable item and the service task uses ${mapVar.get(item)} as the collection and foo as the element variable:

Hi wwitt,

i resolve this with the expression: ${map[(id).longValue()]}

  • map is a process variable like Map<Long, ListLong>

  • id is a string

using this expression in Collection, it works.

anyway thanks a lot for your reply!