DMN Online Simulator / enter null value

Hello,

is it possible to enter null value in the DMN Online Simulator?

If I remove the double value I get following error:
SPIN/JACKSON-JSON-01002 Expected ‘Number’, got ‘NULL’

Kind regards,
Bernd

Hi Bernd,

I don’t think so. The dmn engine expects a value for the column. What would be the use case to not provide the input at all?

Cheers,
Sebastian

Hi Sebastian,

I have simplified the DMN. Your DMN has more than one column. But not every column is mandatory.

I retested this with java unit test. With null amount the “default” value is received.

        amount.setValue(null);
        variables = Variables.createVariables()
                .putValue("transferrelease", banktransfer);

        // Evaluate decision again
        results = dmnEngine.evaluateDecisionTable(decision, variables);

        // Check new result
        assertThat(results).hasSize(1);

        result = results.getSingleResult();
        assertThat(result)
                .containsOnly(
                        entry("releaseType", "DEFAULT")
                );

So I get different result between online simulator and java runtime.

Cheers,
Bernd

Hi Bernd,

you are right. The problem is that the REST API of the DMN Simulator does not accept null values. What you can do is remove the <tr id="inputFor_input1"> table row from the HTML form. Than the javascript code will not send this field and the REST API does not try to parse it. In the engine it will than be handled as null I guess.

Cheers,
Sebastian

The use case not to provide the input at all? … We have a bot… we detect input values for dmn evaluate by asking the user questions for every input variable which was not defined by initial user question… camunda dmn should return all outputs that are matching with the currently known input vars :wink: … it should be possible to send null values then camunda should ignore them for matching :wink:

Hello Team,

I am having trouble with using null inside DMN. If user doesn’t pass any input, should we default it to null or pass an empty string?

In javascript, default value for a variable is undefined. Does it work the same way in Camunda?

I have tried with different variations in dmn to see how it evaluates for null/empty strings. Attached the png for my test DMN.

I am unclear why not(null) expression evaluates to true when I passed null input.

Can someone help me on how to handle null value in DMN and also if there are any best standards to handle default values in DMN?

Thanks in Advance!