Error while trying to use javascript as expression language in DMN

Trying to put together a fairly simple decision table and would like to strictly use javascript(as opposed to learning yet another syntax…)

As a MVP i am simply trying to check if a single input is in a specified array.

Basically: [“A”].includes(cellInput) where cellInput is provided.

Keep getting a error ant cannot seem to understand why…
"FEEL/SCALA-01008 Error while evaluating expression: failed to parse expression '[\"A\"].includes(cellInput)': [1.15] failure: end of input expected\n\n[\"A\"].includes(cellInput)\n ^"

Here is the example for reference:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="" xmlns:dmndi="" xmlns:dc="" id="decision" name="DRD" namespace="" exporter="Camunda Modeler" exporterVersion="4.9.0">
  <decision id="MyDecision" name="My Decision">
    <decisionTable id="DecisionTable_11mhzt9" hitPolicy="FIRST">
      <input id="Input_1" label="My Text">
        <inputExpression id="InputExpression_1" typeRef="string" expressionLanguage="javascript">
      <output id="Output_1" name="Result" typeRef="string" />
      <rule id="DecisionRule_14ioo8t">
        <inputEntry id="UnaryTests_0ltytx1">
        <outputEntry id="LiteralExpression_1710kw6">
      <rule id="DecisionRule_17bwwkc">
        <inputEntry id="UnaryTests_1hh2s22">
        <outputEntry id="LiteralExpression_0l4r2ac">
      <dmndi:DMNShape dmnElementRef="MyDecision">
        <dc:Bounds height="80" width="180" x="160" y="100" />

Any help on this is appreciated!

Hi @hpl002,

You have to specify expressionLanguage for your input entry
<inputEntry id="UnaryTests_0ltytx1" expressionLanguage="javascript">

and use below expression as includes method seems to be unsupported.
["A"].indexOf(cellInput) &gt;= 0

Kindly find attached a working example
test_dmn_005.dmn (1.5 KB)

Thank you very much for this! The community supports always amazes me.

However, i cannot seem to find any way of configuring the expressionLanguage of the inputEntry graphically via camunda modeler. Do you know if this is supported?

Hi @hpl002,

I am facing same thing. :grinning:
I used to change it from XML view.

haha, so seemingly not configurable via the modeler?

I am assuming it defaults to FEEL expressionLanguage (if attribute is not set)

If this is missing then i would be happy to create a feature request on this…

And do you have any info on what javascript runtime the DMN engine supports? Seems extremely limited provided that it does not support Array.prototype.includes()…

Mirror: What javascript runtime is employed by the DMN engine?


Right click on the input entry, I managed to find it.

1 Like

Aha! Perfect :slight_smile: