Get error details in subprocess
I have a process with several script tasks. Specifically I have a task that insert data into a database and one that call a webservice
I configured the connectors on those tasks to send an error if the connector fails and created a subprocess to catch those errors. I want to send a mail to a specific email with error details. I found how to get root process instanciator, access process variables... but not how to get the error name or best, the stack trace of the exception that made the connector fail. Even the name of the error that started the subprocess would be a plus
Any hint on how to achieve that?
In the general settings of your first script you could choose
"if a connector fails":
Throw error event, and
In your step (e.g. the service task that contains this script), you can drag and drop a
Catch error Int.event. In the General tab of this error event you choose as "Associated error" :
Then add another service task that contains just an email connector, that sends the email. in the body you can hardcode the cause of the error (it will be from you first script), and maybe values if some related process values.
Then you connect the
Catch error with this new service task.
You can add a
Catch error event for every error that is thown from a script.
Regading the exception i donot know how you could save it.
Hope this helped.
Thanks. I know I could use boundary start events to catch those errors but I wanted something more generic. This is why I am trying to create a subprocess. In this subprocess I could use 2 (or more) error start event and bind the start to a given error message. But for more complex processes with more and more scripts that makes more and more duplicates of the globally same code.
Maybe a solution is to create a subprocess variable, use several start event that set the variable and join all the starts to a single "send mail" action. I will check if this is OK. Edit: that does not work, a sub-process cannot have several start event