Optimal way for branching in orchestrations

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Optimal way for branching in orchestrations

Viewing 1 reply thread
  • Author
    Posts
    • #23951

      Please, suggest what is the best way (optimal in terms of performance) for simple branching in orchestrations:

      1. Using Decide shape
      2. Using Expression shape

      I assume branching with logic like this:

      if(StatusResponse.Status == "3")
      {
         respCode = 0;
      }
      else if(StatusResponse.Status == "4")
      {
         respCode = 1;
      }
      else
      {
         respCode = -1;
      }
      
    • #23983

      micbox,

      I’m not too sure, however given that you can see the C# that is created from an orchestration when it is compiled…

      You could try both in the same orchestration, compile it and look at the C# to determine whether one ‘looks’ more efficient than the other. I would imagine that the decide shape will be compiled into an if…then statement.

      One further point to consider is whether you will actually see any real performance benefit of doing the branch as if statements or decide shapes. I would suggest that in this case readability is more important than any performance gain you are likely to achieve. I always adopt a decide shape over if…then in an Expression Shape as the latter hides the meaning of the code, especially when you are looking at the orchestration in the debugger.

      Hope this helps, Nick.

      Nick.

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