Questions about the task assignment based on DMN example

Hello everyone:
I followed this guide:

and run into below problem.
I defined my DMN with one output field of type String to serve as candidate groups, the out put is like:
“groupA,groupB,groupC”, when I input this in bpmn candidate groups manually, it works fine.
but when I get them via expression like in the example, ${candidateGroups}, it’s treaded as one group that named “groupA,groupB,groupC”.
It’s there a simple fix on this, I want it to act like when I input candidateGroups manually seperated by commas.

Hi @LevinHelix ,

In case expression is used and we have multiple groups then return type should be a collection.

You can define an output parameter as script for the business rule task and use below script to convert the string value of the result variable “strGroups” to a collection value “colGroups” to be assigned as candidateGroups
java.util.Arrays.asList(strGroups.split(","))

Kindly find attached example (bpmn and dmn files)

test_str.bpmn (3.3 KB) test-dmn.dmn (1.1 KB)

One more question, in my DMN their is two columns of output(both typed String), how can I use java script to retrieve one of them, and what Map Decision Result type should I choose, I am trying it myself, just leave a question here.

Ok I think I should use SingleResult as the Decision Result type and use strGroups.get(’’) to get my column, then split it using above javascript.
Thank you for your timely answer, hassang.