Here is a updated version that uses JSON objects and javascript throughout:
array_test.dmn (1.4 KB)
array-input-dmn.bpmn (7.8 KB)
Few major changes were needed to accommodate JSON objects:
-
adding .value() to the input expression of the DMN. So now the expression for the input is:
collElement.value()
. -
The Collection field of the Business Rule Task, in the Multi-Instance section was set to:
${collection.prop("collection").elements()}
. An interesting aspect was that when the elements are passed to the DMN they are still passing as JSON rather than a String. And this is occurring even though the JSON is not valid json. @camunda this is a possible bug? Basically each element that was passed in the DMN was Typed as JSON but when you inspected the data in the cockpit it would show the value of the JSON object as something likeSystem 1
. No array, no JSON brackets, etc. So it would appear as a String. -
Array Generation was changed to:
var collection = S('{ "collection" : ["System 1", "System 3"] }');
execution.setVariable("collection", collection)
var jsonValue = S('{ "values":[] }')
execution.setVariable("combinedResult", jsonValue)