none
Response from FILE adapter RRS feed

  • Question

  • I have an application to generate COPARN EDI files using the below orchestration. At the send port if any failure has occured then i have used the failed message routing to capture the error details. If any error does not occur in the send port then i need log those as successful transaction in the database. For this how can i check whether the send port (FILE adapter) has transmitted the message without any failure in the orchestration??.

    Regards, Vivin.

    Tuesday, September 30, 2014 11:59 AM

Answers

  • If your orchestration needs to continue after transmission failure you can store the result of the transmission in a boolean value. For example, you can add a varTransmissionSuccess variable to your orchestration and put the default value to true.
    If you have a Microsoft.XLANGs.BaseTypes.DeliveryFailureException you can put that boolean value to false.
    After your scope shape you can then based on the boolean value insert or not insert into your DB.

    Then your orchestration can continue...


    Glenn Colpaert - MCTS BizTalk Server - Blog : http://blog.codit.eu

    • Marked as answer by Angie Xu Tuesday, October 7, 2014 3:02 AM
    Wednesday, October 1, 2014 7:32 AM

All replies

  • In your orchestration where you defined your logical SendPort you can set the DeliveryNotification. Put that DeliveryNotification to 'Transmitted'.
    Then you put a try catch around your SendPort and catch the Microsoft.XLANGs.BaseTypes.DeliveryFailureException. If that Exception occurs your file has not been transmitted in a correct manner.

    For a detailed description see Ken't Weare's blog: http://kentweare.blogspot.be/2007/11/biztalk-delivery-notification.html


    Glenn Colpaert - MCTS BizTalk Server - Blog : http://blog.codit.eu

    • Proposed as answer by Johns-305MVP Tuesday, September 30, 2014 2:14 PM
    Tuesday, September 30, 2014 12:15 PM
  • Hi,

    The only way to satisfy this requirement is with an Orchestration that uses the Delivery Notification feature on the One Way Send Port that sends the incoming message to the File Send Port.

    http://anantm.wordpress.com/2011/03/03/delivery-notification-demystified/

    When orchestration sends out a message using a send port which has delivery notification set to transmitted, it internally initiates a correlation on that send port, it sets AckRequired = true, and CorrelationID = guid, and expects an ACK or NACK. When ACK is received, it continues the execution from the last persistence point. When NACK is received it throws a Delivery Failure exception.

    Rachit

    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.


    Wednesday, October 1, 2014 4:14 AM
    Moderator
  • Hi Glenn,

    Suppose if i dont get any exception at the send port then i need to log that too in the DB that the process has been completed successfully.How can this be done??


    Regards, Vivin.

    Wednesday, October 1, 2014 5:05 AM
  • You have different options to achieve that:

    You can for example after the scope of your Send shape with delivery notification put an Expression shape that executes a piece of C# to store certain data in the DB.
    You can also create another message and send shape and connect that send shape to another logical port that has a WCF-SQL connection to your database to insert some data into your database.

    There is a good article on the WCF-SQL adapter available on the Technet Wiki : http://social.technet.microsoft.com/wiki/contents/articles/18906.biztalk-server-wcf-sql-adapter-table-operations.aspx


    Glenn Colpaert - MCTS BizTalk Server - Blog : http://blog.codit.eu

    Wednesday, October 1, 2014 6:25 AM
  • I already have an orchestration subscribing to failed messages. My requirement is if the messages are failed at the send port then that has to be logged as failure and if the message is transmitted successfully then that has to be logged as success.

    But as you suggested to do success logging after the scope shape would result in duplication (when exception occured, the failure logging will be done and after that a success logging will also be done.)

    I have already implemented my loggin concept for EDI file downloading in DB. But i am not sure how to do the same process for EDI file generation.


    Regards, Vivin.

    Wednesday, October 1, 2014 6:52 AM
  • Question: does your orchestration have to continue after an transmission failure? Or does a transmission failure results in a 'Business Error' and therefor you have to stop the processing of the message? Or is a retry required?

    Glenn Colpaert - MCTS BizTalk Server - Blog : http://blog.codit.eu

    Wednesday, October 1, 2014 6:57 AM
  • After a transmission failure the orchestration need not continue. Also if any validation error occurs the message processing should be stopped and retry is not required.

    Regards, Vivin.

    Wednesday, October 1, 2014 7:28 AM
  • If your orchestration needs to continue after transmission failure you can store the result of the transmission in a boolean value. For example, you can add a varTransmissionSuccess variable to your orchestration and put the default value to true.
    If you have a Microsoft.XLANGs.BaseTypes.DeliveryFailureException you can put that boolean value to false.
    After your scope shape you can then based on the boolean value insert or not insert into your DB.

    Then your orchestration can continue...


    Glenn Colpaert - MCTS BizTalk Server - Blog : http://blog.codit.eu

    • Marked as answer by Angie Xu Tuesday, October 7, 2014 3:02 AM
    Wednesday, October 1, 2014 7:32 AM