开发用于映射复杂嵌套的重复消息的消息流和消息模型

开始之前
这是执行简单消息扩充方案的第五阶段。本主题说明如何开发用于映射复杂嵌套的重复消息的消息流和消息模型。本主题还包括开发相应的实例文档。
  1. 在 COMPLEX 消息定义中(在名称空间 www.complex.net 中),创建名为 addev3 的消息,该消息的结构如下:
      addev3
       选项
          sstr (xsd:string) local element
          intrep (xsd:int) local element, minOcc=2, maxOcc=6
          dur (xsd:duration) local element
       选项
          comp1 local complex element
             dat1 (xsd:date) local element
             sval (xsd:string) local element
          comp2 local complex element
             bool1 (xsd:boolean) local element         dat2 (xsd:date) local element
          comprep local complex element, minOcc=1, maxOcc=4
             int1 (xsd:int) local element
             dec1 (xsd:decimal) local element
       binel (xsd:hexBinary) local element
       lelem local complex element, base type xsd:string
          latt (xsd:int) local attribute
       lcomp local complex element
          head (xsd:string) local element
          incomp local complex element
             count (xsd:int) local element
             comp:gcompel global complex element, minOcc=0, maxOcc=-1
                fstr (xsd:string) local element
                multel local complex element
                   in1 (xsd:boolean) local element
                   in2 (xsd:string) local element
                   in3 (xsd:float) local element
          footer (xsd:string) local element
       repstr (xsd:string) local element, minOcc=1, maxOcc=-1
  2. 创建名为 addev3 的消息流,该消息流包含以下映射:> Mapping > MQOutput。
  3. 打开映射并选择 addev3 作为源和目标。
  4. 将每个源元素映射到其相应的目标元素:
    sstr --- sstr
    intrep --- intrep
    dur --- dur
    dat1 --- dat1
    sval --- sval
    bool1 --- bool1dat2 --- dat2
    int1 --- int1
    dec1 --- dec1
    binel --- binel
    lelem --- lelem
    latt --- latt
    head --- head
    count --- count
    fstr --- fstr
    multel --- multel
    footer --- footer
    repstr --- repstr
  5. 在“电子表格”窗格中,将第一个 condition 从 fn:true() 更改为 fn:exists($source/comp:addev3/sstr)
  6. 将第二个 condition 从 fn:true() 更改为 fn:exists($source/comp:addev3/intrep)
  7. 将第三个 condition 从 fn:true() 更改为 fn:exists($source/comp:addev3/dur)
  8. 将第一个复杂选项 condition 从 fn:true() 更改为 fn:exists($source/comp:addev3/comp1)
  9. 将第二个复杂选项 condition 从 fn:true() 更改为 fn:exists($source/comp:addev3/comp2)
  10. 将第三个复杂选项 condition 从 fn:true() 更改为 fn:exists($source/comp:addev3/comprep)
  11. 使用适当的 RFH2 头创建以下实例消息:
    <comp:addev3 xmlns:comp="http://www.complex.net">
    <sstr>first</sstr>
    <comp1>
    <dat1>2005-06-24</dat1>
    <sval>date value</sval>
    </comp1>
    <binel><![CDATA[3132333435]]></binel>
    <lelem latt="24">twenty four</lelem>
    <lcomp>
    <head>nesting start</head>
    <incomp>
    <count>3</count>
    <comp:gcompel>
    <fstr>first</fstr>
    <multel>
    <in1>1</in1>
    <in2>C</in2>
    <in3>2.45E+1</in3>
    </multel>
    </comp:gcompel>
    <comp:gcompel>
    <fstr>second</fstr>
    <multel>
    <in1>1</in1>
    <in2>D</in2>
    <in3>7.625E+3</in3>
    </multel>
    </comp:gcompel>
    <comp:gcompel>
    <fstr>third</fstr>
    <multel>
    <in1>0</in1>
    <in2>C</in2>
    <in3>4.9E+0</in3>
    </multel>
    </comp:gcompel>
    </incomp>
    <footer>nesting end</footer>
    </lcomp>
    <repstr>abc</repstr>
    <repstr>def</repstr>
    <repstr>ghi</repstr>
    <repstr>jkl</repstr>
    <repstr>mno</repstr>
    </comp:addev3>
    <comp:addev3 xmlns:comp="http://www.complex.net">
    <intrep>45</intrep>
    <intrep>12</intrep>
    <intrep>920</intrep>
    <comp2>
    <bool1>1</bool1>
    <dat2>2005-06-24</dat2>
    </comp2>
    <binel><![CDATA[3132333435]]></binel>
    <lelem latt="24">twenty four</lelem>
    <lcomp>
    <head>nesting start</head>
    <incomp>
    <count>5</count>
    <comp:gcompel>
    <fstr>first</fstr>
    <multel>
    <in1>1</in1>
    <in2>C</in2>
    <in3>2.45E+1</in3>
    </multel>
    </comp:gcompel>
    <comp:gcompel>
    <fstr>second</fstr>
    <multel>
    <in1>1</in1>
    <in2>D</in2>
    <in3>7.625E+3</in3>
    </multel>
    </comp:gcompel>
    <comp:gcompel>
    <fstr>third</fstr>
    <multel>
    <in1>0</in1>
    <in2>C</in2>
    <in3>4.9E+0</in3>
    </multel>
    </comp:gcompel>
    <comp:gcompel>
    <fstr>fourth</fstr>
    <multel>
    <in1>1</in1>
    <in2>F</in2>
    <in3>2.98E+1</in3>
    </multel>
    </comp:gcompel>
    <comp:gcompel>
    <fstr>fifth</fstr>
    <multel>
    <in1>0</in1>
    <in2>D</in2>
    <in3>8.57E-2</in3>
    </multel>
    </comp:gcompel>
    </incomp>
    <footer>nesting end</footer>
    </lcomp>
    <repstr>abc</repstr>
    </comp:addev3>
    <comp:addev3 xmlns:comp="http://www.complex.net">
    <dur>P2Y2M</dur>
    <comp3>
    <int1>6</int1>
    <dec1>2821.54</dec1>
    </comp3>
    <comp3>
    <int1>41</int1>
    <dec1>0.02</dec1>
    </comp3>
    <binel><![CDATA[3132333435]]></binel>
    <lelem latt="24">twenty four</lelem>
    <lcomp>
    <head>nesting start</head>
    <incomp>
    <count>0</count>
    </incomp>
    <footer>nesting end</footer>
    </lcomp>
    <repstr>abc</repstr>
    <repstr>def</repstr>
    <repstr>ghi</repstr>
    <repstr>jkl</repstr>
    <repstr>mno</repstr>
    <repstr>pqr</repstr>
    <repstr>stu</repstr>
    <repstr>vwx</repstr>
    </comp:addev3>
已创建下列资源:
现在部署消息集和消息流。

部署消息集和消息流

这是简单消息扩充方案的第六阶段。本主题说明如何部署消息集和消息流,并通过代理运行实例消息。
  1. 创建名为 addev3 的 BAR 文件。
  2. 将消息集 MAPPING3_COMPLEX_messages 和消息流 addev3 添加到 BAR 文件。
  3. 将 BAR 文件部署到代理。
  4. 将实例文档放在输入队列上。
输出消息类似于:
<comp:addev3 xmlns:comp="http://www.complex.net">
<sstr>first</sstr>
<comp1>
<dat1>2005-06-24</dat1>
<sval>date value</sval>
</comp1>
<binel><![CDATA[3132333435]]></binel>
<lelem latt="24">twenty four</lelem>
<lcomp>
<head>nesting start</head>
<incomp>
<count>3</count>
<comp:gcompel>
<fstr>first</fstr>
<multel>
<in1>1</in1>
<in2>C</in2>
<in3>2.45E+1</in3>
</multel>
</comp:gcompel>
<comp:gcompel>
<fstr>second</fstr>
<multel>
<in1>1</in1>
<in2>D</in2>
<in3>7.625E+3</in3>
</multel>
</comp:gcompel>
<comp:gcompel>
<fstr>third</fstr>
<multel>
<in1>0</in1>
<in2>C</in2>
<in3>4.9E+0</in3>
</multel>
</comp:gcompel>
</incomp>
<footer>nesting end</footer>
</lcomp>
<repstr>abc</repstr>
<repstr>def</repstr>
<repstr>ghi</repstr>
<repstr>jkl</repstr>
<repstr>mno</repstr>
</comp:addev3>
<comp:addev3 xmlns:comp="http://www.complex.net">
<intrep>45</intrep>
<intrep>12</intrep>
<intrep>920</intrep>
<comp2>
<bool1>1</bool1>
<dat2>2005-06-24</dat2>
</comp2>
<binel><![CDATA[3132333435]]></binel>
<lelem latt="24">twenty four</lelem>
<lcomp>
<head>nesting start</head>
<incomp>
<count>5</count>
<comp:gcompel>
<fstr>first</fstr>
<multel>
<in1>1</in1>
<in2>C</in2>
<in3>2.45E+1</in3>
</multel>
</comp:gcompel>
<comp:gcompel>
<fstr>second</fstr>
<multel>
<in1>1</in1>
<in2>D</in2>
<in3>7.625E+3</in3>
</multel>
</comp:gcompel>
<comp:gcompel>
<fstr>third</fstr>
<multel>
<in1>0</in1>
<in2>C</in2>
<in3>4.9E+0</in3>
</multel>
</comp:gcompel>
<comp:gcompel>
<fstr>fourth</fstr>
<multel>
<in1>1</in1>
<in2>F</in2>
<in3>2.98E+1</in3>
</multel>
</comp:gcompel>
<comp:gcompel>
<fstr>fifth</fstr>
<multel>
<in1>0</in1>
<in2>D</in2>
<in3>8.57E-2</in3>
</multel>
</comp:gcompel>
</incomp>
<footer>nesting end</footer>
</lcomp>
<repstr>abc</repstr>
</comp:addev3>
<comp:addev3 xmlns:comp="http://www.complex.net">
<dur>P2Y2M</dur>
<comp3>
<int1>6</int1>
<dec1>2821.54</dec1>
</comp3>
<comp3>
<int1>41</int1>
<dec1>0.02</dec1>
</comp3>
<binel><![CDATA[3132333435]]></binel>
<lelem latt="24">twenty four</lelem>
<lcomp>
<head>nesting start</head>
<incomp>
<count>0</count>
</incomp>
<footer>nesting end</footer>
</lcomp>
<repstr>abc</repstr>
<repstr>def</repstr>
<repstr>ghi</repstr>
<repstr>jkl</repstr>
<repstr>mno</repstr>
<repstr>pqr</repstr>
<repstr>stu</repstr>
<repstr>vwx</repstr>
</comp:addev3>
声明 | 商标 | 下载 | 书库 | 支持 | 反馈
Copyright IBM Corporation 1999, 2006 最后一次更新时间:2006/08/14
ar25251_5_