Team Individualism (old blog)

Consultant ramblings

Wednesday, October 12, 2005

Calling sub-orchestration issues

Just forgetting stuff makes me write entries in this blog.

When calling a sub-orchestration in BizTalk 2004 you need to specify parameters. If a parameter is an OUT parameter BizTalk isn't sensible enough to make a new message. You have to construct (using the big chunk construct scope) a new message for the one coming out.

Now heres the gotcha. If you don't construct the message AND add some data to the message then all sorts of badness happens to your orchestration. Not least of which is that the orchestration that runs cannot be debugged. We were getting empty part exceptions from the depths of the called orchestration and only after serious amounts of debugging did we find that the problem was in fact the empty document.

From MSDN Adding parameters to orchestrations

Parameter types

Parameters can be passed by value, as reference parameters, and as out parameters. When a parameter is passed by value to an orchestration, a copy of the data is made and used by the orchestration.

When you use a reference parameter, no copy is made. The memory location that contains the data is shared between the calling program and the orchestration, and the contents of this memory location can be modified by the orchestration. Such a modification means that the value of the parameter is changed not only in the orchestration, but also in the calling program.

An out parameter is similar to a reference parameter, but the orchestration cannot assume that it contains valid data when passed in; rather, the calling program expects the orchestration to assign a value to this parameter.

0 Comments:

Post a Comment

<< Home