Design and Architecture Related Question

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Design and Architecture Related Question

Viewing 2 reply threads
  • Author
    Posts
    • #20086

       Hi,

      I am new to Biztalk development have following requirements:-

      I need to transfer medication orders from one system(say Host) to another system(say Destination). The access to Destimation system is via WEB service APIs.

      Once an order is submitted successfully, it’s fulfilled by Destination system in due course of time, and i need to poll the Destination system to fidn out the status of the order and Send the status back to Host system.

      Now i am storing the Order details that are being transmissted through Biztalk process in a simple sql server database table(OrderNo, DateCreated, Is_Fullfilled), which gets updated whenever an order is fullfilled.

      Does storing the information is sql server makes sense, or there is a better way of doing it?

       

      Thanks,

      Mukesh.

      [email protected]

       

       

       

       

    • #20087

      Mukesh,

      You haven’t mentioned how the messages are being received from your Host system, so I’ll assume you’re receiving an Xml file that you are picking up over a FILE adapter for simplicity’s sake.

      With regards to your system, I would suggest that the file received from your Host system is used to invoke an orchestration. This orch would send the message to the Destination system using a SOAP adapter and save the details of the message to the SQL Server as you mentioned; this provides you with a simple database check to determine whether the message was successfully sent.

      Now, for polling the Destination system for the status of the order, you can either:

      1. Use the same orch created above and use a loop to repeatedly check the status of the order in the Destination system using the SOAP adapter and the WS’s exposed by that system. If the status returned as ‘not actioned’ for example, the orchestration would enter a delay shape and dehydrate to the Message Box (the timing of the delay is up to you depending on the turn-around time you want, i.e. you could wait for 1 minute before checking again, or possibly 24 hours) and then pass back through the loop to check the Destination system a second time. Using a loop, you would need to have a strategy to stop the loop after X iterations. Once you have received a successful response from the Destination system, exit the loop and send a response message back to the Host system.
      2. Use a second orch which is invoked by a polling SQL Adapter. The polling SQL Adapter would poll every X minutes for orders that have not been completed by the Destination system, invoking an orchestration for each un-completed instance. The orchestration itself would call the WS on the Destination system to determine the status of the order. If the order is not yet completed, the orchestration would stop gracefully. If the order is completed, the order record in the table could either be updated to indicate a date/time that the order was completed, or simply deleted. The response to the Host system would then be generated and sent.

      I would personally suggest that you go for the second approach as it implements a Spearation of Concerns pattern – i.e. the first orchestration is simply responsible for sending the data to the Destination system and the second for polling. Furthermore, using the second approach, you will not have a large number of dehydrated orchestrations sat around waiting to finish and is therefore (in my opinion), much cleaner. Also, the polling mechanism is pushed to the SQL Adapter; other polling mechanisms are available (such as using the BizTalk Scheduling Adapter (see Codeplex) or the Windows Task Scheduler, but both of these approaches introduce undue complications.

      Hope this helps, if you have any further questions, please drop me a line.

      Cheers, Nick.

      • #20092

         

        Thanks a lot Nick for your response. I really appreciate it.

        Just to answer your question, Host system is sending order messages(in XML format) to BizTalk message box and i would have an orchestration which will pick these messages and post to Desitnation system.

        And again thanks for confirming my choice of SQL server database, this gives me more confidence about the approach being followed.

        Someone said that using SQL Server from Orchestration is a Red flag! I don’t understand why it’s red flag and just wanted to understand what are the other options available.

        Could you thinnk of any cons of sql server approach, if any.

         

        Regards,

        Mukesh.

         

         

         

         

         

         

        • #20093

          Mukesh,

          Calling SQL Server from a .Net Helper class in an orchestration is (IMHO) a bad idea because BizTalk cannot manage the database connection (without a lot of work on your behalf); it is much easier to use the SQL Adapter which can be invoked through Send & Receive Ports to perform any CRUD work that is required – you also get all of the BizTalk Enterprisey features if you take this route as the request and response messages traverse the Message Box.

          Rgds, Nick.

    • #20088

      Mukesh,

      You haven’t mentioned how the messages are being received from your
      Host system, so I’ll assume you’re receiving an Xml file that you are
      picking up over a FILE adapter for simplicity’s sake.

      With regards to your system, I would suggest that the file received
      from your Host system is used to invoke an orchestration. This orch
      would send the message to the Destination system using a SOAP adapter
      and save the details of the message to the SQL Server as you mentioned;
      this provides you with a simple database check to determine whether the
      message was successfully sent.

      Now, for polling the Destination system for the status of the order, you can either:

      1. Use the same orch created above and use a loop to repeatedly check
        the status of the order in the Destination system using the SOAP
        adapter and the WS’s exposed by that system. If the status returned as
        ‘not actioned’ for example, the orchestration would enter a delay shape
        and dehydrate to the Message Box (the timing of the delay is up to you
        depending on the turn-around time you want, i.e. you could wait for 1
        minute before checking again, or possibly 24 hours) and then pass back
        through the loop to check the Destination system a second time. Using a
        loop, you would need to have a strategy to stop the loop after X
        iterations. Once you have received a successful response from the
        Destination system, exit the loop and send a response message back to
        the Host system.
      2. Use a second orch which is invoked by a polling SQL Adapter. The
        polling SQL Adapter would poll every X minutes for orders that have not
        been completed by the Destination system, invoking an orchestration for
        each un-completed instance. The orchestration itself would call the WS
        on the Destination system to determine the status of the order. If the
        order is not yet completed, the orchestration would stop gracefully. If
        the order is completed, the order record in the table could either be
        updated to indicate a date/time that the order was completed, or simply
        deleted. The response to the Host system would then be generated and
        sent.

      I would personally suggest that you go for the second approach as it
      implements a Spearation of Concerns pattern – i.e. the first
      orchestration is simply responsible for sending the data to the
      Destination system and the second for polling. Furthermore, using the
      second approach, you will not have a large number of dehydrated
      orchestrations sat around waiting to finish and is therefore (in my
      opinion), much cleaner. Also, the polling mechanism is pushed to the
      SQL Adapter; other polling mechanisms are available (such as using the
      BizTalk Scheduling Adapter (see Codeplex) or the Windows Task
      Scheduler, but both of these approaches introduce undue complications.

      Hope this helps, if you have any further questions, please drop me a line.

      Cheers, Nick.

Viewing 2 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.