DMN evaluation variables

Hi,

To evaluate DMN the , when the variables passed have “.”, the DMN engine throws error

{
“variables”:
{
“invoice.name”: {
“value”: “sara”,
“type”: “String”
},
“invoice.amount” : { “value” : 600, “type” : “Integer” }
}
}

Error:

{
“type”: “RestException”,
“message”: “Cannot evaluate decision saraBrandNew:12:cb39d878-393f-11ea-bed1-427d05fefade: Exception while evaluating decision with key ‘null’”
}

Hi. Can you show the dmn model and a more complete log?

saraBrandNew.dmn (1.7 KB)

Attached DMN

This is the REST API response (500 error)

Error:

{
“type”: “RestException”,
“message”: “Cannot evaluate decision saraBrandNew:12:cb39d878-393f-11ea-bed1-427d05fefade: Exception while evaluating decision with key ‘null’”
}

@ jherencia

I checked the dmn. In the “Input Expression” field it’s not necessary to add “${}”, and I think you should be aware by using ‘.’ (point) in a variable name because it will recognize “invoice” as an object having “name” and “amount” as its attributes.
I tested by replacing “invoice.name” by “invoice_name” and the same for the “amount” and it works.

1 Like

Thanks for response. I was looking for passing invoice object as payload for DMN evaluation. Did not find any example for this. ANy pointers would be helpful.

In that case you can pass something like this:

{
    "variables": {
        "invoice": {
			"value": {
				"name": "sara",
				"amount": 600
			}
		}
    }
}
1 Like