FEEL expression syntax


#1

Hi guys,

I have a Json process variable which I am accessing in a DMN table. Hence I am using an expression such as;

not(APPLICATION.prop(“applicant”).prop(“name”).stringValue())

All works fine. However I would like to use a substring. Hence if I try;

not(APPLICATION.prop(“applicant”).prop(“name”).stringValue().substring(0,6))

I get a FEEL exception;

org.camunda.bpm.dmn.feel.impl.juel.FeelConvertException: FEEL-01015 Unable to convert …value of type String to type Long…

Hence if I get string from stringValue(), can I use its intrinsic methods inside a FEEL expressions?

regards

Rob


DMN JSON Object Parsing + Single Object for All Inputs
#2

A slight update,

I found the following works. Hence it looks like the comma separating parameters in a function call confuses the FEEL parser…

not(APPLICATION.prop(“applicant”).prop(“name”).stringValue().substring(6))

Any ideas on how to escape a comma parameter separator inside a function call?

P.S. As a workaround, the following achieved the outcome I needed;

not(APPLICATION.prop(“applicant”).prop(“name”).stringValue().split(" ")[0])

regards

Rob


#3

Hi Rob,

I created a bug ticket for this CAM-5831. Currently the feel transformer will interpret every comma as a list delimiter and does not ignore method parameters.

I think the only workaround currently is to use JUEL instead. Which would be something like:

cellInput == not(APPLICATION.prop("applicant").prop("name").stringValue().substring(0,6))

Cheers,
Sebastian


#4

Sorry for reopening this old topic. I have exactly the same problem. I’m trying to feed a process variable of type object via the REST API. The BPMN process contains a decision task with a reference to a DMN deployed in Camunda. I want to use the member variables of the object as input for the DMN decision table using either FEEL or JUEL. This discussion here is the only documentation I found on how to do that. I figured that APPLICATION is the name of the process variable. My object is called product and has properties like prodType of type string and isResearch of type boolean.
I tried FEEL first and wrote: product.prop(“prodType”).stringValue()
That led to an exception “Simple Expression not supported by FEEL engine”.
Then I tried JUEL with the expression: cellvalue = product.prop(“prodType”).stringValue()
and it said: “Unable to evaluate expression for language JUEL”.

Then I found the blogpost about the FeelScala plugin,
https://blog.camunda.com/post/2017/03/feel-scala/
but I was not able to get it running. I followed the instructions to place the jar (I used version 1.8.0) in the camunda lib folder and put the config-entry in the conf/bpm-platform.xml
However, camunda did not start anymore after that. It threw a ton of exceptions
It seems, that the bpm-platform.xml does not allow a tag.

I would be very grateful if somebody could point me to my error or the documentation explaining all that stuff. I’m using camunda standalone as an own microservice and want to interface via the REST API. My request body of the POST to start the process is
{
“variables” : {
“product”: {
“value” : “{“prodType”:“Scheibenmodell A”, “lastProcessStep”:“1”, “isResearch”:“false”}”,
“type” : “json”,
“valueInfo” : {}
}
}
}
Thanks in advance for your help
René


#5

Hi @rpeinl,

try to use the following JUEL expression: product.prop(“prodType”).stringValue()

Does it work? If not, please share the error from the log.

Or, you could use the FEEL expression product.prodType via FEEL-Scala engine.

If something doesn’t work, please share the errors.

Best regards,
Philipp