Decision Tables

Hi, I am trying to use Decision Tables but have some questions about it. I hope someone can help me out here. I am pretty new to Camunda and trying to implement it into our software.

I am not using Java, only use external processes that will be picked up by our micro services.

I used a decision table with a single output field and type Unique, so I would catch the result in a variable and was able to use it in my process. That went quite smooth. But now I want to extend it and have multiple output variables. Also more then one rows can be true, and I want to aggregate the results.

Say: I have a dmn with five boolean output columns that have either true or - as a value. Multiple rows in the dmn can be true, but in the end I wanta list of the five features with true values (so not an array with five items per row)

imageCategorization: true means DownloadImage and CategorizeImage are true in the output.
imageHashing: true means DownloadImage and HashImage are true in the output.

So if both imageCategorization and imageHashing are true I’d have {DownloadImage: true, CategorizeImage: true, HashImage:true} (and not something like: [{DownloadImage: true, CategorizeImage: true}, {DownloadImage: true, HashImage: true}])

How could I achieve this ? I see an option to map input and output parameters, but I can not seem to find out how they work, although I think I should be able to get this to work with the help of that…
I should probably use the policy COLLECT right ? because more rows can be true.

I hope someone can help me with this.

Hi @mac_doggie,

you can go with either with hit policy Collect or Rule Order.

Expect a result as a List of Maps from the decision, if you have more than one output column.

I your case you need some postprocessing to convert the list of maps into a single map.

Here you can read more about the decision results: https://docs.camunda.org/manual/7.10/user-guide/process-engine/decisions/bpmn-cmmn/#predefined-mapping-of-the-decision-result

Hope this helps, Ingo

Hi, thanks for the reply. I have read it, but am still unsure on how to do the reduce. Could you show me an example on how to make a single hashMap out of the list?