1

We are doing POC on business rules using CodeEffects rule engine. Trying to write evaluation rules using rule editor. Here question is how to use + operator between custom functions to evaluate specific rule. For example, I would like to write rule like below

check if(somefunc(somevar1)+somefunc(somevar2)+somefun(somevar3) is greater than [1]

Please help how to write such rule in editor.

Satya
  • 11
  • 1

1 Answers1

0

You need to use the calculation option (the "Add calculation..." menu item) as the value of your condition. Keep in mind that in Code Effects each condition must begin with either a field or an in-rule method. Because of that, your rule needs to be changed as follows:

    Check if Somefunc(Somevar1) is greater than
       { Somefunc(Somevar2) + Somefunc(Somevar3) - [1] }

Notice that the result of the evaluation is still the same, I just moved some rule elements around.

Alex
  • 566
  • 1
  • 6
  • 14
  • Thanks Alex for the suggestion! I have chosen option Add calculation and after opening curly brace by choosing Add calculation menu item, it opened curly brace in editor but it is not showing my custom functions on menu, it is just showing "Add a number" option. Am I missing some setting here? – Satya Apr 03 '18 at 21:23
  • @Satya The calculation section only works with numeric values. All your functions must return numeric value type if you want them to show up in calculation menus. – Alex Apr 04 '18 at 13:04
  • yes my function returns numeric value only, but still not showing up in calculation menu. – Satya Apr 04 '18 at 17:19
  • To add more details I am using CodeEffects 4.1.9.6 version – Satya Apr 04 '18 at 18:29
  • I just upgraded to latest version 4.3.6.7 from 4.1.9.6. Now it is not displaying my custom functions at all in menu. – Satya Apr 04 '18 at 20:19
  • @Satya Could you post your source object here? Or at least its properties and methods? – Alex Apr 10 '18 at 20:22