Need to conditionally display section only on successful a!queryEntity results

I have an application database that is unreliable in its availability.  The UI rule that calls the expression rule works great when the db is available, but fails often with the message Expression evaluation error at function a!queryEntity [line 38]: An error occurred while retrieving the data. 

I want to be able to not display this section if the expression rule call fails and instead put a message like "the database is currently not available, please try this again in the future" rather than have the alarming pink message display.

Is there a best practice or design pattern I can refer to that handles this? 

  Discussion posts and replies are publicly visible

Parents
  • 1. There is no exception handling mechanism in SAIL.
    2. So developers rely on doing the checks in if(). And checking for null, empty output from SAIL expression evaluation.
    3. The above is an error because when database connection is not available, SAIL expr. evaluation fails. Catching this exception is somethings that we would do in a traditional programming language.
    4. If we had some function to check if the datastore connection is available - we could wrap this in a if() and avoid the exception on the UI. Technically the above error is an exception and Appian stops the SAIL evaluation immediately. The only way I see we can handle such scenario is by creating some external webservice/ping the database hostname:port to find if its running. Frankly - that is too much of effort.
  • Good explanations and I agree with it all. I was hoping someone had accomplished #4 on your list.
  • Hi Wayne,

    I actually did #4 a while back, but I'm sure it can be improved upon. I basically had a process always running that would ping a table in the specified database and if the ping was not successful after 10 seconds, a constant was set to False to indicate the connection was currently down, otherwise the constant would remain as True.

    With this process constatly running, you would then be able to use the constant in and if() statement as @chetany indicated above.

    If you're interested, I can package up the process I used and you can modify as you see fit,
Reply
  • Hi Wayne,

    I actually did #4 a while back, but I'm sure it can be improved upon. I basically had a process always running that would ping a table in the specified database and if the ping was not successful after 10 seconds, a constant was set to False to indicate the connection was currently down, otherwise the constant would remain as True.

    With this process constatly running, you would then be able to use the constant in and if() statement as @chetany indicated above.

    If you're interested, I can package up the process I used and you can modify as you see fit,
Children