Handling null values inside DMN via FEEL

Hi,
I am trying to work on simple conditions inside the DMN table to have the null checks in place before performing any function on the variable itself. However, I am facing issues as the FEEL engine is throwing errors.

I am using Camunda BPM Runtime 7.18 community edition with JDK 1.8.0_332. I have also attached the DMN table to simulate the issue.

I am trying to work out the condition below in the cell input which is failing with an error when “objname” is null.
matches(objname,“^.*”)

“Suppressed failure: illegal arguments: List(ValNull, ValString(^.*))”

I tried combining the null check before the “matches” function call but it seems the FEEL engine is still not liking it.
objname != null and matches(objname,“^.*”)

“ENGINE-16004 Exception while closing command context: Unable to evaluate script:TypeError: null has no such function "split" in at line number 1”

I was going through the documentation of FEEL Scala and according to it this should work but somehow it isn’t, can you please help me out if I am missing some syntax construct or if is there some other way of doing it?
Experiment.dmn (2.7 KB)

Hi @suraj

I believe an expression similar to this should work

if objname != null then matches(objname,“^.*”) else false

Hi @hassang,

The error is still the same.

ENGINE-16004 Exception while closing command context: Unable to evaluate script:TypeError: null has no such function "split" in at line number 1

However, according to this link, it should work the way I wanted to make it work right?

If the above syntax is working for one it should have been working for me, I don’t know what changed or what I am missing in this context.

In your DMN decision table, I see that the input expressions are not set. As a result, the variables objname and condition1 will be null.

Instead of setting an input variable, you should set an input expression. For example, referencing a variable by its name objname.

Does this help you?

1 Like

Hi @suraj

That are exactly the problems I made a DMN Tester :wink:.
Check it out if you want to check if your DMN is valid.

3 Likes