Camunda Feel Context Function put all

Hi
I have a dmn which holds default values in json format
{
“delayUntilOrigin”: now(),
“delayUntilIntervalDays”: “0”,
“delayUntilTime”: “16:00”
}

and another dmn which takes the above json and replace one property with different value.

To achieve that, am using put all function , like
put all(defaultCalculation,{“delayUntilIntervalDays”: “10”})

But dmn engine unable to identify feel function put all. Even put does not work.

I get below error,
org.camunda.bpm.dmn.feel.impl.FeelException: FEEL/SCALA-01008 Error while evaluating expression: failed to parse expression ‘put all(defaultCalculation,{“delayUntilIntervalDays”: “10”})’: [1.5] failure: end of input expected

I have got dependency
testImplementation group: ‘org.camunda.bpm.dmn’, name: ‘camunda-engine-dmn’, version: “7.14”
testImplementation group: ‘org.camunda.bpm’, name: ‘camunda-engine’, version: ‘7.14.0’

Can you please suggest what could be wrong?

Thanks
Vamtest-dmn.dmn (4.8 KB)

Hi @Vamshidhar_Reddy_Chi,

these functions were introduced in FEEL-Scala version 1.13.0. Camunda platform 7.14 uses the version 1.12.2.

You should update to Camunda platform 7.15.

Best regards,
Philipp

1 Like

Updated to 7.15 and I see it recognizes put or put all function.

In DMN I want to override one of the properties

put(defaultCalculation,“delayUntilIntervalDays”,“10”) - where defaultCalculation is a context defined in
a new DMN
{
“delayUntilOrigin”: now(),
“delayUntilIntervalDays”: “0”,
“delayUntilTime”: “16:00”
}

put(defaultCalculation,“delayUntilIntervalDays”,“10”) returns null.
How do I override with the feel expression?

@Philipp_Ossler , can you please help on the above feel context expression?

Hi @Vamshidhar_Reddy_Chi,

Please make sure to keep type as empty for Context variable

image

I am attaching an example. test_context.dmn (3.7 KB)

You can test with below snip of code

DmnDecision decision = dmnEngine.parseDecision("decision2", inputStream);
		
VariableMap variables = Variables.createVariables().putValue("empty_input", "").putValue("test_input", "Hi");
DmnDecisionTableResult results = dmnEngine.evaluateDecisionTable(decision, variables);
1 Like

The empty type for Context solved the problem.

Thank you.

1 Like