Catch "Write to Database" Smart Service exceptions

Hi, All:
I have a question about exception thrown by write to db smart service: Is there any way to catch the exception(any db transaction exception) so that to handle it gracefully like bypassing following nodes to end the whole process instance. We do not want this smart service node simplLY got stuck with just sending alert message, leading he whole process instance incomplete.

OriginalPostID-229706

OriginalPostID-229706

  Discussion posts and replies are publicly visible

  • Always the best design would be having the DB nodes as a subprocess in Asynchronous mode, Unless you don't require the sequence id in the process which is generated from the Write to DB node.
  • Thanks for the response. But my specific is that in case of exception, I need to branch out to end event so I need to find out if there is an exception on db node. I just wonder how to catch that or is there a way to find that. thanks
  • A few things:

    1) Most DB transaction errors are predictable, so your design should be able to avoid most error scenarios before activating the DB write.

    2) It's not perfect, but you can infer an exception using a timer. For instance, activate a node scheduled to execute 10 minutes from when it is reached at the same time you activate your DB write. Cancel the time node if your DB write finishes successfully. If the 10 minutes is reached, there was probably an error and you can have your process route to your error logic. Note that this will not work if you need to chain the user to a subsequent form.

    3) If you can make your logic work in SAIL, the new smart service functions (including write to data store) have some built in error handling capabilities. Check the documentation for more info.

    Hope that helps.
  • Just a variation of what andrewg has mentioned,
    1) Wrap your smart service within a sub-process.
    2) Add an (timer based) exception flow to that sub-process.

    If there is an error in the smart service, the sub-process would get hung-up and the exception flow would be taken. That way your process could become aware of an exception. You could also add error notifications to this exception path.