Result mapping for a decision task with Hit policy Collect and multiple Outputs

Hi Guys,

Need a quick pointer.

We have a DMN with two output variables.

Now we are trying to create a process with two DMN tasks in it (decision chaining).


However modeler seems to be always expecting only one Result Variable (beverages – highlighted in red colour). How to configure it to expect two variable (i.e beverages & crisps) rather than just one.

Any help is greatly appreciated. Thanks for your time.

2 Likes

If you have hit policy collect and multiple outputs, then basically the result is a list of maps and you need to choose resultList for the “Map Decision Result” property.
The variable you name will then contain an object tof type List<Map<String, Object>> such that for each rule which evaluated to true there will be a map in the list and the map is indexted by the name of the output.

These Docs sections may be instructive:

1 Like

Thanks for your quick reply Daniel. I think I didn’t phrase my question correctly and on top of it my example hit policy wasn’t right. Sorry about that.

It will be great, if you can kindly review below example.

We are trying to chain multiple decisions in a single process here. First decision gives multiple outputs, which are used as inputs in the second decision. I understand the whole process is straight forward if we have only one result coming out of the decision. Since we have two outputs here, I am not quite sure how to model it so they can be used as inputs in the second decision.

Hope you can clarify.

Process:

First decision (with multiple outputs):

Second decision (using previous outputs as inputs)

Thanks for your valuable time.

In the Decision Dish you have Hit Policy Unique. Only a single rule can be matched. You also have multiple outputs. The result will be a Map<String, Object> where the key is the name of the output. In Map Decision Result you correctly selected singleResult. In Result Variable you put the name of the variable under which the map will be stored ie. dish. In the next table you can then use ${dish.dish} and ${dish.crisps} as input expressions for your colums.

Does this make sense to you?

Aah, I get it now. Thanks so much Daniel. Appreciate it.