Using scripts inside DMN-table and testing it


#1

Hello, :slight_smile:
lets say i have a processvariable named “number of something”, which is an input parameter of the DMN-table. Now i want to add a second input parameter, which should contain the value “number of something modulo 10”. I think i need a script task for this. Am i right? This is my DMN-File: ModuloExample.dmn (1.6 KB)

I have tried it by using the script like this:

If i run it on https://camunda.org/dmn/simulator/ it isn’t working. So i have two questions:

  1. How can i archieve a simple modulo operation as an input parameter in a dmn-file?
  2. Is it possible to test DMN-files with scripts on the fly through https://camunda.org/dmn/simulator/ or https://dmn.camunda.cloud/ ?

Thank you very much for your help!


#2

Hi @Andy,

you can calculate the modulo value in the input expression itself. For example, you can use the JUEL expression numberOfSomething % 10. The Javascript expression is equal.

Best regards,
Philipp