How to parse the decision result on the "input/output" tab of a business rule task?


I have a business rule task implemented by DMN.

My decision table (hit policy collect) can return back multiple rows (rules), that each of them has two values (columns).

For example, in case that two rows of the DMN table match,
I have a result like the following:


Returning back to the properties panel of the business rule task, the “General” tab, looks like this:

Further, I need in the “Input/Output” tab to go through the list of results, picking the “group” value from each row. I want to do this by using javascript.

Something like the following does not work:

What do I need to change inside my js code?

var i;
(for i=0;i<result.length;i++){

After I will use the candidateGroup in the parameter “Candidate Groups” of a user task.
So, I will use something like this: ${candidateGroup}

Could you please help me on that?

Thank you,

Hi Smith,

So if I understand your issue correctly, you want to transform this snippet:



["IT", "HR"]

If that’s correct, the following snippet should do the trick:

var i, output = [];
for (i = 0; i < result.length; i++) {

Please try this out and let me know if that’s what solves your problem.

Thanks for your reply @barmac.

I would like to ask you why I need the last line of code.


is it a way to return the value back to the engine?

According to the docs, the last statement of the script is the return value. However, please check if it works correctly.

I tried this on a simple script task and it seems that instead of plain output you may need to convert it first to a proper java type:, 'java.lang.String[]').