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.
Discussion posts and replies are publicly visible
Can you add:
then we have a better chance of diagnosing what's happening.
Please use the "</>Insert Code" option when posting code
thanks
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
)
Several things to observe/consider here:
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.
Also... how will a!queryentity() even behave if called in the expression for a rule? I don't assume it will constantly re-execute. Will it re-execute any time the RI's value is changed, even? I'd have to try this myself before being able to confidently recommend anything either way.
+1 on understanding the use case more. In general most appian developers don't use rule events on process models very often because there's often a better way to achieve the same solution.
This is what we trying to do , the process variable is a output parameter from the previous sub process. But instead of waiting on the Rule Event it throws the provided error message. can you please confirm the ideal case , will Rule Event get reevaluated once the pv! gets updated. (not for our current implementation but to know how it works.)
Thanks Stewart, we did redesign our code to use script task to check if pv! has been updated if not loop it with timer to wait for 1 minute and rerun the script task.
I would be interested in how many of these processes do you plan to run? Depending on the numbers, I would like so suggest to decouple things completely.