none
Multiple Receive Shapes in an orchestration RRS feed

  • Question

  • Hi all,
    I have an orchestration that has multiple receive shapes inside of it. One starts the orchestration because it will be fire through a WCF service, and the others 2 ( there are 3 in total) go to a service that has different methods, so, messages are not related ( the first one is jsut to get a Key and the second one is just to get a confirmation ). So biztalk keeps saying that I need a correlation but i do not need a correlation since messager are different, they come from the same service, but are different operations. Any Clue?

    best regards

    Luis Diego Rojas. http://icomparable.blogspot.com
    MCP, MCTS Biztalk Server
    Tuesday, February 9, 2010 5:12 PM

Answers

  • Thanks!

    You are mixing up things Luis. You have to have a clear understanding about who is the client and who is the server when using web services.

    Your implementation
    If you are starting your orchestration via WCF you don't need to have add a reference and then use messages and ports. The WCF is going to be the client that is going to call your Orchestration and will receive a response from it. If this is your case as far as I understand, you don't have to add references to your orchestration. Simply create a request and response messages of your type create a normal port which receives a message and sends one. Add a receive shape at the beginning and at the end to send the response to the WCF client. While in the orchestration if you need to call other WCF service that WCF service will behave as a server service and your orchestration as a client. You have to add references for it and use the reverse port (solicit request-response) and send and receive messages from it. At the end send a response message to the WCF client.

    Then publish your orchestration as a WCF service from the WCF service publishing wizard. To code your client add the reference or generate the proxy class via command. Call the service. Have the proper endpoint settings in your web config and you are good to go.


    Abdul Rafay - MVP & MCTS BizTalk Server
    blog: http://abdulrafaysbiztalk.wordpress.com/
    Please mark this as answer if it helps.
    • Marked as answer by Luis D. Rojas Tuesday, February 9, 2010 9:57 PM
    Tuesday, February 9, 2010 8:37 PM

All replies

  • Sure you need a correlation.
    For example, the input is A1, A2, A3, B1, C1, B2,B3, B4, A4, C2, C3.
    Message A starts the orchestration.
    A1 -> O1
    A2 -> O2
    A3 -> O3
    then are comming Bs and Cs. How can orchestrations recognize the "right" message?
    Say O1 should consume B1 not B2 and not B3. How does O1 recognize B1? Only by correlation (for example A and B have the same "customer" value inside).
    Leonid Ganeline [BizTalk MVP] Biztalkien blog
    Tuesday, February 9, 2010 5:24 PM
    Moderator
  • You cannot activate an orchestration with multiple receive shapes. One receive shape must have its activate property to true. So when the message that is published to the message box the orchestration is subscribed to that message and the receive shape having the message type is the subscribing message type.

    Logically how would you have more than one receive shape with this design?

    Now orchestration can have more than one receive shape but with these conditions.

    1- One receive shape must be set to activate the orchestration and of course this should be the first shape in the orchestration flow to start it.

    2- The other receive shapes can be in the orchestration and your orchestration can receive those messages but it depends on the convoy of message that the orchestration is getting.

    A- If you know the message order you can set your orchestration design as a sequential convoy.
    B- If the ordering does not matter and you dont even know how the messages will be received by the orchestration you should implement the orchestration as a parallel convoy.

    For Correlation sets:
    Correlation sets are implemented for sequential convoys. One message initiates the correlation set while the others follow in the sequential convoy. Now you know about the error message what it means and where you should use correlation sets.

    For sequential convoys you should have a parallel shape and all the branches can have receive shapes in it and all the receive shapes can have its activate property to true. But this conflicts what I said above, TRUE. Parallel shape design is different, the orchestration does not proceed to the next shape and remains on the parallel shape unless all the branches are not executed successfully and the order of the branches execution does not matter that is why it is called a parallel shape.
    So any incoming message in the branch can activate the orchestration and I think this will fit your solution. Let me know.

    Oh yeah I also have a blog entry (I forgot). All this stuff is there along with the downloadable example.

    http://abdulrafaysbiztalk.wordpress.com/2009/11/07/enterprise-integration-pattern-part-5-aggregator-sequential-convoy/






    Abdul Rafay - MVP & MCTS BizTalk Server
    blog: http://abdulrafaysbiztalk.wordpress.com/
    Please mark this as answer if it helps.
    Tuesday, February 9, 2010 5:56 PM
  • The problem is that I'm activating the orchestration thourgh a WCF service - locally defined - which has a message that allows me to send parameters to the others ports. So, as I wrote before, the service wsdl generate ports for me, but the request port needs a receive shape and the response port needs a send shape - this is in case of ports 2 and 3. The main message ( the one that comes through WCF ) has parameters for the other ports, so I transform a message just to send the parameters to the receive shape 2, then with the response from port 2 and part of the message 1, I build a messege and send it to the port 3. So eventhough both logical ports belong to the same service, I have no way of relating the message, no properties are related. The question then is, why some wsdl generate request ports that need a receive message instead of a send message?
    Luis Diego Rojas. http://icomparable.blogspot.com
    MCP, MCTS Biztalk Server
    Tuesday, February 9, 2010 6:44 PM
  • the orchestration should be able to identify the messages because I'm invoking the service operation ... ( at least this is what I want to do ) The problem is that the request port for the operation generated is expecting a receive shape inside the orchestration and not a send shape ( as i would suppose ). So, any clue why it is generating the logical ports in that way?

    best regards

    Luis Diego Rojas. http://icomparable.blogspot.com
    MCP, MCTS Biztalk Server
    Tuesday, February 9, 2010 6:47 PM
  • What I understand that you are trying to do is this.

    1- Send a message to your orchestration through WCF client to activate it.
    2- In the orchestration call other ports? I think you want to call another WCF service from your orchestration. By ports you mean that?
    3- Then send a response back from the orchestration to the WCF client.


    Please clarify this so that we can help...

    Abdul Rafay - MVP & MCTS BizTalk Server
    blog: http://abdulrafaysbiztalk.wordpress.com/
    Please mark this as answer if it helps.
    Tuesday, February 9, 2010 8:14 PM
  • Yes, 
    I found that the port communication direction was generated like receive - send and it should be send and receive. I changed and seems to work. Do you know what are the wsdl parameters for the port being generated with the communication direction in that way?

    best regards

    Luis Diego Rojas. http://icomparable.blogspot.com
    MCP, MCTS Biztalk Server
    Tuesday, February 9, 2010 8:26 PM
  • by the way, great blog post!


    Luis Diego Rojas. http://icomparable.blogspot.com
    MCP, MCTS Biztalk Server
    Tuesday, February 9, 2010 8:26 PM
  • Thanks!

    You are mixing up things Luis. You have to have a clear understanding about who is the client and who is the server when using web services.

    Your implementation
    If you are starting your orchestration via WCF you don't need to have add a reference and then use messages and ports. The WCF is going to be the client that is going to call your Orchestration and will receive a response from it. If this is your case as far as I understand, you don't have to add references to your orchestration. Simply create a request and response messages of your type create a normal port which receives a message and sends one. Add a receive shape at the beginning and at the end to send the response to the WCF client. While in the orchestration if you need to call other WCF service that WCF service will behave as a server service and your orchestration as a client. You have to add references for it and use the reverse port (solicit request-response) and send and receive messages from it. At the end send a response message to the WCF client.

    Then publish your orchestration as a WCF service from the WCF service publishing wizard. To code your client add the reference or generate the proxy class via command. Call the service. Have the proper endpoint settings in your web config and you are good to go.


    Abdul Rafay - MVP & MCTS BizTalk Server
    blog: http://abdulrafaysbiztalk.wordpress.com/
    Please mark this as answer if it helps.
    • Marked as answer by Luis D. Rojas Tuesday, February 9, 2010 9:57 PM
    Tuesday, February 9, 2010 8:37 PM