Ens.Alert: How to invoke Ens.Alert from <catchall> in Business process
Hello All,
I am exploring Ens.Alert to generate alerts for Server exceptions.
I noticed that in the business operation, if you have your code inside try/catch and if your catch doesn't explicitly invoke $$$systemerror then Ens.Alert is not invoked.
Similarly, in the Business process if you have <catchall> then Ens.Alert is not invoked on error. How can I invoke Ens.Alert from <catchall> ?
Another thing I noticed is, if I dont catch exceptions in BO and BP and have "Alert on error" ON for both, if there is an error in BO, 2 alerts are generated for same error, one from BO and one from BP. Can we avoid 2 alerts for the same error?
Thanks heaps!
Utsavi
I haven't actually tried this, but I suspect it's as simple as creating a message of type Ens.AlertRequest, populating it, and <call>ing Ens.Alert asynchronously in the <catchall>.
Or maybe insert an <alert> action?
Thanks Jeffrey. <alert> was it. Do you know if there is a way of catching errors in a DTL ?
The <transform> action seems to hide the return value of the call to the DTLName.Transform() method, but you should be able to call it in a code action and obtain it:
Set xform=##class(My.DTL.Class).%New() Set tSC = xform.Transform(SrcMsg, .TgtMsg)
If there's been an error, tSC should tell you what it is ...