An activatable receive must be the first executable statement in a service



Whenever we add the Orchestration to a project, the first thing which is done almost every time is to add Receive shape as the first shape. 

That’s because we need to apply some process when some particular piece of info (message) is obtained. Thus initiating the process designed in the orchestration.

Receive shape is used to receive the incoming message from message box using Inbound logical port i.e. A Receive shape allows messages to be routed from the Message Box to the orchestration.


Well this raised a question, can’t other shapes be used as the first shape in Orchestration?

BizTalk Server orchestrations receive messages either through a Receive shape or directly from another orchestration as an orchestration input parameter.

To find out more out of curiosity, I added a loop shape as a first shape with a Receive shape within it. 

Logically it seemed correct as I want to receive messages until the loop condition is satisfied.


orchestration with loop

But when clicked on build following error appeared

first executable statement



As the error says, if the Activate property of a Receive shape is set to True, then Receive must be the first action in the orchestration.

With all said it’s obvious to think that  the first shape has to be Receive Shape . 

However, if the Activate property is set to False on all Receive shapes, your orchestration must be called by another orchestration in order to run.


So can we use some other shapes as first shape in Orchestrations, yes there are shapes  like 
  • Group shape
  • Scope Shape
  • Listen Shape
  • Parallel shape
  • Orchestrations configured with parameters to enable invocation from other orchestration.



Will keep sharing as and when find something!!!!! 


If you have questions or suggestions, feel free to do in comments section below !!!


Do share if you find this helpful .......
 
                   Knowledge Sharing is Caring !!!!!!


Learn More about BizTalk


Post a Comment

If you have any suggestions or questions or want to share something then please drop a comment

Previous Post Next Post