Check if a variable which only exists at runtime but only in certain contexts exists

A Score Level 1

How do you check if a variable which only exists at runtime but only in certain contexts (i.e. if called from a record view it'll not be there but from a task it will) exists?

What I'm trying to do is find out where an expression rule is being used at runtime and logging that information for us to help diagnose a performance issue. These expression rules are used in hundreds of places across the application so it's not feasible to try and diagnose that way. We want to be able to see where the rule was called from, i.e. process node, interface, record list, record view, task... We've settled on checking the existence of pp!id / tp!id / rf!id to get information about where it came from and then query the analytics with that to identify the chain all the way back up to identify how it was executed. However, if you query these variables in the wrong context (e.g. pp!id when the rule is used in a record view), it errors out as the variable doesn't exist at runtime.

Any ideas?

Thanks in advance,

Caz

  Discussion posts and replies are publicly visible

Parents
  • As far as I know, checking a variable's existence at runtime is not possible in Appian.  This would require try/catch type functionality which is currently not available.  There is an undocumented try() function but it is not recommended to use (could be removed at any time) and will not work for this scenario anyway - returns the same error if a variable is not available.  

    Note the Admin Console Rule Performance area may assist with narrowing down time frames of longer executions to map to other process/task reports, and/or verifying there is not a surrounding issue.  Other than what you are doing already, I would suggest applying many different rule test cases.  

Reply
  • As far as I know, checking a variable's existence at runtime is not possible in Appian.  This would require try/catch type functionality which is currently not available.  There is an undocumented try() function but it is not recommended to use (could be removed at any time) and will not work for this scenario anyway - returns the same error if a variable is not available.  

    Note the Admin Console Rule Performance area may assist with narrowing down time frames of longer executions to map to other process/task reports, and/or verifying there is not a surrounding issue.  Other than what you are doing already, I would suggest applying many different rule test cases.  

Children
No Data