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

  • 相关阅读:
    【XSY2720】区间第k小 整体二分 可持久化线段树
    【XSY2719】prime 莫比乌斯反演
    【XSY2718】gift 分数规划 网络流
    【CTSC2017】【BZOJ4903】吉夫特 卢卡斯定理 DP
    【XSY2729】欧拉子图 无向图连通性 数学
    【XSY2730】Ball 多项式exp 多项式ln 多项式开根 常系数线性递推 DP
    【BZOJ1999】【NOIP2007】树网的核 单调队列优化DP
    NOIP2017游记
    【BZOJ2127】happiness 网络流
    【BZOJ3625】【CF438E】小朋友和二叉树 NTT 生成函数 多项式开根 多项式求逆
  • 原文地址:https://www.cnblogs.com/cbcye/p/1304018.html
Copyright © 2011-2022 走看看