Help forming error handling email! - KeithP

20-Jul-07 09:50:16
I have an orchestration that is set up to receives routed error
messages from my other biztalk applications.  In this error handling
orchestration, I receive the routed error as an xmldocument
(msg_Error), then create an email message (msg_Email) in an assignment
shape using the code I've copied at the bottom of this post.  My
problem is that sometimes I encounter an error that does not seem to
have a value for the ReceivePortName or the InbountTransportLocation -
this causes my error handling to blow up in the expression shape.  Is
there a way that I can test for these values and only try to access
them if they exist?  I thought of using an custom class library to to
put the stringbuilder together inside a try/catch - but I don't know
how to pass the error message (msg_Error) to the class with the
ErrorReport values in tact.  Can anyone help????


EXPRESSION SHAPE CODE:
stMsgBody = new System.Text.StringBuilder();
stMsgBody.AppendLine("");
stMsgBody.AppendLine("Desc:" + msg_Error(ErrorReport.Description));
stMsgBody.AppendLine("Type:" + msg_Error(ErrorReport.ErrorType) + "<br/
stMsgBody.AppendLine("Receive Port Name:" +
msg_Error(ErrorReport.ReceivePortName) + "<br/>");
stMsgBody.AppendLine("Receive Location:" +
msg_Error(ErrorReport.InboundTransportLocation));
stMsgBody.AppendLine("");

msg_Email.EmailBody = new
DOC.BizTalk.CustomComponents.XlangCustomFormatters.RawString(stMsgBody.ToString());
msg_Email.EmailBody(Microsoft.XLANGs.BaseTypes.ContentType) = "text/
html";

msg_Email.OriginalMessage = msg_Error;
msg_Email(SMTP.Subject) = "BizTalk Routed Error Notification";
msg_Email(SMTP.EmailBodyFileCharset) = "UTF-8";
msg_Email(SMTP.MessagePartsAttachments) = 2;
reply
 
 

Help forming error handling email! - RichardSerote

20-Jul-07 11:12:01
In similar situations I've had a helper component that took in the
distinguished field as a (object) parameter, and the component checks for
empty or null values before returning a formatted response.
--
Richard Seroter
http://seroter.wordpress.com
reply
 

Help forming error handling email! - KeithP

20-Jul-07 03:09:38
that sounds like what I would like to do, but I'm not sure how to pass
field you are interested in as a seperate parameter or is there a way
to pass an object that contains them all?

Thanks so much for your help.
reply
 

Help forming error handling email! - RichardSerote

20-Jul-07 04:56:01
In my case, I just created a static method like so ...

public static string ExtractValue(object distValue)
{
//check for null, or empty
}

and called it for each item that I needed handled.  Not sure how I'd pass
the whole distinguished field property bag in, unless you want your operation
to accept the XLangMessage itself ...
--
Richard Seroter
http://seroter.wordpress.com
reply
 

Help forming error handling email! - Jan Eliasen

05-Aug-07 05:22:58
in your expression shape:
exists <property> <message>
it returns a boolean describing whether the property exists.

--
eliasen, representing himself and not the company he works for.

Private blog: http://blog.eliasen.dk

Private email: jan@eliasen.dk
reply
 
Unable to generate a temporary class (result=1
promotion
Silverlight    WPF    WCF    WWF    LINQ   
JavaScript    AJAX    ASP.NET    XAML   
C#    VB.NET    VB 6.0    GDI+    IIS    XML   
.NET Generics    Anonymous Methods    Delegate   
Visual Studio .NET    Expression Blend    Virus   
Windows Vista    Windows XP    Windows Update   
Windows 2003 Server    Windows 2008 Server   
SQL Server    Microsoft Excel    Microsoft Word   
SharePoint    BizTalk    Virtual Earth   
.NET Compact Framework    Web Service   

"Everything" RSS / ATOM Feed Parser
How to send and receive messages through message queuing in .Net
How to Read text file as database
SQL Server 2005 Paging Performance Tip
Display code of web page.
Fully Scalable Excel File Importer class for .net using Microsoft Jet driver
Generic Chart Color Manager class that can be used for any charts
Helper class to style the infragistics wingrid
Using Reflection to detemine as Assembly Info in and out.
Helper class to play with Window (Owners and position)
Resolving displayname from the culture using the XmlLanguage and LanguageSpecificStringDictionary class