Because the development needs to sometimes execute pipeline in the process. For example, retrieve the message string from a field in the DB and construct the message in the process. You must use pipeline to update the attribute field and verify the message. This interface is already available in the BizTalk architecture: xlangpipelinemanage class. The following is an example of using the receive and send ports in the process. The Microsoft. xlangs. Pipeline component (c: \ Program Files \ Microsoft BizTalk Server 2006 \ microsoft. xlangs. pipeline. dll) must be referenced in the project)
1. Use the receiving Pipeline
- Call executereceivepipeline () in the xlangpipelinemanage class to execute the receiving pipeline.
Method Code in xlangpipelinemangae class:
Public static receivepipelineoutputmessages executereceivepipeline (type receivepipelinetype, xlangmessage inmsg );
- Create a new variable vrecout type in the process: receivepipelineoutputmessages
- Create a schema with the schmsg type defined
- The value of the constructed message expression is:
Vrecout = Microsoft. xlangs. pipeline. xlangpipelinemanager.
Executereceivepipeline (typeof (testpipelines. myrecpipeline), inputmsg );
Schmsg = NULL; // initialize the Output Message.
Vrecout. movenext (); // default method of ielement.
Vrecout. getcurrent (schmsg );
Testpipelines. myrecpipeline is the queue's fully qualified name (fully qualified name), including the namespace and class name.
Inputmsg is the input message, that is, the message to be sent to the MPs queue.
2. Use a sending Pipeline
- Call executesendpipeline () to execute the sending pipeline.
Method Code in xlangpipelinemangae class:
Public static void executesendpipeline (type sendpipelinetype, sendpipelineinputmessages inmessages, xlangmessage outxlangmsg );
- Create a new variable in the process. The vinmsgs type is sendpipelineinputmessages.
- Create a message whose sendmsg type is "Send Pipeline.
- The value of the expression used to construct a message is:
Vinmsgs. Add (inputmsg );
Sendmsg = NULL;
Microsoft. xlangs. pipeline. xlangpipelinemanager. executesendpipeline (typeof (testpipelines. mysendpipeline), vinmsgs, sendmsg );
Testpipelines. mysendpipeline is the queue's fully qualified name (fully qualified name), including the namespace and class name.
Inputmsg is the input message, that is, the message to be sent to the MPs queue.
Note:To construct a message, you must execute it in the constructor shape and select the message to be constructed in the constructor shape. Otherwise, the following error is reported:
Illegal attempt to update the value of part 'part' in XLANG/s message 'inputmsg 'after the message construction was complete
Biztalk Development Series (11): Execute pipeline in orchestration