Since we are determining at run time the location of the
document in SharePoint, we will use a dynamic port in the Orchestration. This
will be determined based on the content of the message. This type of routing
is referred to as Content Based Routing in BizTalk 2006.
Add a new BizTalk project. You will need to add some shapes
to the orchestration; below is a sample snapshot of all of the shapes being used
for this demo.
Notice that on the orchestration, we are only routing on the
Category of the document being submitted. However, in a real world
application, there might be more than one field to be used to determine where
the final destination might be.
This is what the finished orchestration looks like:
Here is a snapshot of the Orchestration tab:
Inside the Construct message we will have the following
1 //Messages are immutable
2 outMsg = InMsg;
4 //if the form is found on the library, then overwrite it with this new one.
5 outMsg(WSS.ConfigOverwrite) = "yes";
7 //turn this off, if you are to insert the InfoPath PI's to the form.
8 outMsg(WSS.ConfigOfficeIntegration) = "no";
10 //set the filename in here
11 outMsg(WSS.Filename) = InMsg.Book.ISBN + ".xml";
13 //set the base library in here:
14 sWSS_SiteLocation = @"wss://evo/BookReview/";
For the PI that you are dynamically creating, add the
//adjust the file attachment PI
outMsg(XMLNORM.ProcessingInstructionOption) = 1;
Inside the medical of the Expression shape, we execute this
//add the location of the folder in here.
sWSSTargetPathLocation = sWSS_SiteLocation + "Medical";
Then on the last expression shape, labeled Dyn WSS Address,
we dynamically set the address where this document is going to be sent.
//set the destination of the dynamic form based on the criteria above.
WSS_BookReview(Microsoft.XLANGs.BaseTypes.Address) = sWSSTargetPathLocation;