0

I have an if-else condition for Camunda DMN:

if(x = 0) {
   z = 0;
} else {
   if(y = 0) {
      z = 1;
   } else {
      z = 2;
   }
}

I have this in Camunda table:

     Input      |     Output
----------------------------------
  x    |    y   |        z
----------------------------------
  0    |    -   |        0
 !=0   |    0   |        1
 !=0   |   !=0  |        2

My "Hit Policy" is "First" but I'm getting an error of "Syntax error '!=0'" when running a unit test on Java on it.

Cell Expression Language is 'feel'.

What is the way to show "not equal" in Camunda DMN?

  • That is the actual requirement. I just changed variables to general. If GeneralAmount is equal zero, equate RetailPrice to 0. If GeneralAmount is not zero and BulkAmount is zero, RetailPrice is 2 but if BulkAmount is not zero, RetailPrice is 3. You don't need to know the variables because it doesn't add depth to the problem. – newProgrammer005 Sep 15 '22 at 14:55
  • Sorry I misunderstood the question and will delete my comment. +1 to @tarilabs answer. – Markus Sep 15 '22 at 18:16

1 Answers1

1

in DMN standard FEEL language, the unary test for "not zero" is:

not(0)

ref https://www.omg.org/spec/DMN

tarilabs
  • 2,178
  • 2
  • 15
  • 23
  • Another useful link describing this is here: https://camunda.github.io/feel-scala/docs/reference/language-guide/feel-unary-tests – Markus Sep 15 '22 at 18:14