none
Exception Handling in Biztalk Orchestration RRS feed

  • Question

  • Hi all,

    I have handled the exception from the send and receive port using the Errorreport promoted property in my EDI application. But I need to handle exceptions that are raised from the orchestration also. Kindly advice how to handle the same with a sample code.


    Regards, Vivin.

    Tuesday, June 3, 2014 5:48 AM

Answers

  • That's because in Orchestrations Contexts are only Written not Promoted when you write to them. If you want them Promoted (as they must be in order to use them for routing), you need to create a correlation.

    Morten la Cour

    • Marked as answer by Vivin Muthu Monday, June 9, 2014 8:49 AM
    Monday, June 9, 2014 5:36 AM

All replies

  • Hi Vivin,

    You can use ESB Exception Management Framework shipped with BizTalk to handle Exception which ocuured in your Orchestration .

    Depending upon your requirement , you can also leverage ESB Management portal

    Links

    .How to handle Exception within Orchestration

    Thanks

    Abhishek

    Tuesday, June 3, 2014 6:12 AM
  • How do I get the error type,error description for the message in the orchestration???

    Regards, Vivin.

    Tuesday, June 3, 2014 6:45 AM
  • Is it possible to assign values to the ErrorReport.Errortype and ErrorReport.ErrorDescription promoted properties in orchestration manually??? If so kindly advice how it can be done.

    Regards, Vivin.

    Friday, June 6, 2014 6:35 AM
  • Hii, 

    Yes , You can use use and assign values in orchestration using xpath in expression shape , 

    xpath(Message_new, "//*[local-name()='RootNodeNmae']/@ERRORDESC") = Message_old(ErrorReport.Description);  

    xpath(Message_new, "//*[local-name()='RootNodeName']/@ERRORType") = Message_old(ErrorReport.ErrorType);

    By using this line of code you can assign value ErrorReport.Description value to child element name ERRORDESC


    Friday, June 6, 2014 7:07 AM
  • Hi Nagori,

    My requirement is just the opposite of it. I need store say a string "Exception" in the promoted property ErrorReport.ErrorType.


    Regards, Vivin.

    Friday, June 6, 2014 7:15 AM
  • Hii Vivin ,

    For this you create varible String "Exception" in orchestration view , and can store the value of ErrorReport.Errortype by using expression shape for that particular Message in String.

    Exception = Message(ErrorReport.ErrorType);

    Friday, June 6, 2014 9:19 AM
  • Hi Nagori,

    The output I need is like this (assigning value for the ErrorReport.ErrorType property)

    ErrorReport.ErrorType="OrchestrationFailure";

    But this says that "Cannot implicitly convert System.String to ErrorReprt.ErrorType"


    Regards, Vivin.

    Friday, June 6, 2014 9:47 AM

  • You need to set it on a specific message, in a message assignment shape like this:

    msgError(ErrorReport.ErrorType) = "OrchestrationFailure";

    Here are all the properties in the ErrorReport namespace:

    http://msdn.microsoft.com/en-us/library/aa578516.aspx

    Morten la Cour

    Friday, June 6, 2014 9:52 AM
  • Hi Morten,

    I have assigned values for the promoted properties "ErrorReport.Description" and "ErrorReport.ErrorType" in the message assignment shape in the orchestration under the CatchException as below.

    ExpMessage="";
    ExpMessage(ErrorReport.Description)=ExceptionObj.Message;
    ExpMessage(ErrorReport.ErrorType)="OrchestrationFailure";

    But the same is not caught in the Exception application (a separate application for catching the exceptions).

    The 'Direct' binding (on incoming messages in messagebox) is used in the receive port and the "Activate" property of the receive shape is set to true and the "Filter Expression" is as ErrorReport.ErrorType Exists.

    Kindly advice why the same is not caught in the Exception application.


    Regards, Vivin.

    Monday, June 9, 2014 4:57 AM
  • That's because in Orchestrations Contexts are only Written not Promoted when you write to them. If you want them Promoted (as they must be in order to use them for routing), you need to create a correlation.

    Morten la Cour

    • Marked as answer by Vivin Muthu Monday, June 9, 2014 8:49 AM
    Monday, June 9, 2014 5:36 AM
  • Thanks Morten!! For which property the correlation has to be done in order to promote the property??? Cant the properties be promoted any other way??

    Regards, Vivin.

    Monday, June 9, 2014 6:19 AM
  • The only use I know is that correlation is used to process files based on the promoted property. How can correlation used for other purposes?


    Regards, Vivin.

    Monday, June 9, 2014 6:25 AM
  • Hi Morten, I tried as you said by adding correlation and the issue is fixed. And when I checked the error description is being displayed as "An XML error has occurred." when transformation failure occurred in orchestration. How to get the exact content of the error description which is will be displayed in the event log when transformation failure occurs. As of now I am using the below statement to get the error description. 

    ExpMessage(ErrorReport.Description)=ExceptionObj.Message;

    Also I need to get the other properties like file name,receive location,messageid,instanceid etc. Kindly advice.


    Regards, Vivin.

    Monday, June 9, 2014 9:12 AM
  • hello vivinmuthu,

    did you find answer for your question. Can you share with me, because I also work with the similar requirement.

    Thanks

    Thursday, September 11, 2014 6:46 PM
  • Hello vdhana,

    Yes i found the soultion to my problem by using the exception handler message type as system.exception. Kindly advice if this answers your requirement.

    If not can u explain in detail the problem you are facing in a new post and send the link??


    Regards, Vivin.


    • Edited by Vivin Muthu Friday, September 12, 2014 4:49 AM
    Friday, September 12, 2014 4:48 AM
  • Thanks Vivin. I dont know how to construct the message which gives the detail of the error. I created a mutli part message with type System.Xml.XmlDocument. I created a message variable which refers to the multi part. It doesnot work. Can you advice me how did you do it. Thanks for your great help.
    Friday, September 12, 2014 11:00 AM
  • Kindly create a new post with more details (if possible the screenshot) since it is different from the issue here

    Regards, Vivin.

    Friday, September 12, 2014 11:04 AM
  • Friday, September 12, 2014 11:06 AM