web stats
writing to database upon channel error - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 05-05-2010, 11:18 AM
bensong bensong is offline
What's HL7?
 
Join Date: Dec 2009
Posts: 1
bensong is on a distinguished road
Question writing to database upon channel error

Can anyone give me some pointers on how Mirth can perform a custom action when a channel error is detected (any type of error)?

Ideally, what I would like to be able to is write a row to a SQL table when a channel error has been detected. I can then use another app we have written to monitor the table which will send SMS alerts out to our support team.

Would be nice if the Alerts config did more than just sending emails... maybe in the next version?!?

Thanks.
Reply With Quote
  #2  
Old 05-05-2010, 11:21 AM
dans dans is offline
Mirth Employee
 
Join Date: Apr 2007
Location: Irvine, CA
Posts: 590
dans is an unknown quantity at this point
Default

use the post processor. Get the response object from the responseMap. If the status is ERROR you can perform your custom DB operations.
Code:
if(responseMap.get("Destination 1").getStatus() == "ERROR"){
//   do your custom code here
}
__________________
Daniel Svanstedt
Software Engineer
Mirth Corporation

Want professional services, support, and enterprise or virtual appliances? It's all available from the Mirth Corporation:
Mirth Support | Mirth Training | Mirth Appliances | Online Training | Developer Q&A

Don't forget, Mirth Support gives you access to all of our online training videos, and silver support gives you access to developer Q&As!
Reply With Quote
  #3  
Old 07-05-2010, 09:19 PM
jasonn jasonn is offline
Mirth Newb
 
Join Date: May 2010
Posts: 13
jasonn is on a distinguished road
Default

dans,

Going by this:
http://www.mirthproject.org/svn/tags.../Response.java

I think you mean the following:

HTML Code:
if(responseMap.get("Destination 1").getStatus() == com.webreach.mirth.model.Response.Status.FAILURE){
//   do your custom code here
}
Is this right?

Last edited by jasonn; 07-05-2010 at 09:23 PM.
Reply With Quote
Reply

Tags
alerts, error detection, sms

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:54 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation