How to pass array to DMN input variable

array_test.dmn (2.5 KB)

I have a scenario I came across where I have a list (json array) want to pass to DMN input and find all of the matches. Based on the matches i need one output (to achive one output i am using Hitcollection aggregation “SUM”).

Attaching my DMN for your testing.

I am using REST APi for my implementation.

with one input request

{
“variables” : {
“system” :

{ “value” : “System 3”, “type” : “string” }

,
“value” :

{ “value” : 30, “type” : “integer” }

}
}

Output

[{“user”:{“type”:“Integer”,“value”:300,“valueInfo”:{}}}]

With mulitple input - Need a solution for the same

{
“variables” : [{
“system” :

{ “value” : “System 3”, “type” : “string” }

,
“value” :

{ “value” : 30, “type” : “integer” }

}]
}

Output

{ “type”: “MismatchedInputException”, “message”: “Cannot deserialize instance of java.util.LinkedHashMap out of START_ARRAY token\n at [Source: (org.camunda.bpm.engine.rest.filter.EmptyBodyFilter$1$1); line: 2, column: 17] (through reference chain: org.camunda.bpm.engine.rest.dto.dmn.EvaluateDecisionDto["variables"])” }

Refer this post: