Skip to main content
ganeshbabuj
February 15, 2022
Question

Rule Event - Not working as expected

  • February 15, 2022
  • 9 replies
  • 0 views

Appian 20.2 - on-perm

Had used a rule Event on a Process model , defined to call expression rule on it.

instance is broken with error " ERROR:EVAL:@reason=Rule XXX has invalid form, so cannot be evaluated.

refered to link https://community.appian.com/support/w/kb/1239/kb-1794-details-error-eval-reason-index-error-thrown-when-using-escalations-timers-and-exception-flows

and had removed all parameter names while calling the Expression rule.

9 replies

stewart.burchell
February 15, 2022

Can you add:

  • the code for the rule you're calling from the Rule Event
  • how you've configured your Rule Event

then we have a better chance of diagnosing what's happening.

Please use the "</>Insert Code" option when posting code

thanks

ganeshbabuj
February 15, 2022

Rule event is configured on the Process model next to Synchronous sub-process

Rule Event -> New Expression

rule!expressionrulename(pv!parameter)

expressionrulename is an query entity as below

1 input parameter - datatype Integer

code

if(

a!queryEntity(....).totalCount = 0,

true,

false

)

stewart.burchell
February 15, 2022

Several things to observe/consider here:

  • What do you expect to happen if the expression returns false? There isn't anything that is going to cause the rule to be re-evaluated so your process is going to be suspended indefinitely (well, until Appian decides that it's been waiting too long for its own good!)
  • suspending a synchronous process whilst you're waiting for something that may not happen isn't a great user experience. You probably need to re-think your design
  • your code can be made simpler - a!queryEntity(....).totalCount = 0 is either true or false, you do not need to wrap it with an if() statement

I would take a step back and try and articulate what you're trying to achieve with this pattern and see if there are other ways it can be achieved.