zoukankan      html  css  js  c++  java
  • BizTalk开发系列(十一) 在Orchestration中执行Pipeline

    更多内容请查看:BizTalk动手实验系列目录

                          BizTalk 开发系列

        由于开发需要有时要在流程中执行Pipeline。比如从DB的某个字段中取消息的字符串并在流程中构造消息。该需要通过pipeline进行升级属性字段,验证消息等处理。BizTalk架构已经开放了此接口: XLANGPipelineManage类,以下为在流程中使用接收和发送端口示例。需在项目中引用Microsoft.XLANGs.Pipeline组件(C:\Program Files\Microsoft BizTalk Server 2006\Microsoft.XLANGs.Pipeline.dll)

    clip_image001

    1.使用接收管道

    • 在XLANGPipelineManage类中调用ExecuteReceivePipeline()执行接收管道。

                XLangPipelineMangae类中的方法代码:

    public static ReceivePipelineOutputMessages ExecuteReceivePipeline(Type receivePipelineType, XLANGMessage inMsg);
    • 在流程中新建一个变量 vRecOut 类型为:ReceivePipelineOutputMessages
    • 新建一个消息 SchMsg 类型为定义的Schema
    • 在构造消息表达式的值为:
    vRecOut = Microsoft.XLANGs.Pipeline.XLANGPipelineManager.
    ExecuteReceivePipeline(
    typeof (TestPipelines.MyRecPipeline),InputMsg); 
    SchMsg 
    =null//初始化输出消息。
    vRecOut .MoveNext(); //IElement的默认方法。
    vRecOut .GetCurrent(SchMsg );
    
    

    TestPipelines.MyRecPipeline 为管道的Fully Qualified Name(完全限定名称),包括命名空间和类名。

    InputMsg 为输入的消息,也就是要传到管道处理的消息。

    2.使用发送管道

    • 调用ExecuteSendPipeline()执行发送管道。

         XLangPipelineMangae类中的方法代码:

    public static void ExecuteSendPipeline(Type sendPipelineType, SendPipelineInputMessages inMessages, XLANGMessage outXLANGMsg);
    • 在流程中新建一个变量 vInMsgs 类型为SendPipelineInputMessages
    • 新建一个消息 SendMsg  类型为Send Pipeline处理之后的消息。
    • 在构造消息的表达式的值为:
    vInMsgs.Add(InputMsg);
    SendMsg
    =null;
    Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteSendPipeline(
    typeof(TestPipelines.MySendPipeline),vInMsgs,SendMsg);

    TestPipelines.MySendPipeline为管道的Fully Qualified Name(完全限定名称),包括命名空间和类名。

    InputMsg 为输入的消息,也就是要传到管道处理的消息

    注意:构造消息需要在构造形状里执行,并且在构造形状的属性里选择要构造的消息否则会报如下错误

         Illegal attempt to update the value of part 'part' in XLANG/s message 'InputMsg' after the message construction was complete

  • 相关阅读:
    android AsyncTask 详细例子(2)
    解决如何让AsyncTask终止操作
    Android模仿jquery异步请求
    const与define的异同
    PHP5生成图形验证码(有汉字)
    TPCC-UVA测试环境搭建与结果分析
    qconbeijing2018
    qconshanghai2015
    qconshanghai2017
    qconshanghai2016
  • 原文地址:https://www.cnblogs.com/cbcye/p/1304018.html
Copyright © 2011-2022 走看看