ネスト化され、反復する複雑なメッセージをマップするためのメッセージ・フローおよびメッセージ・モデルの作成

始める前に
これは、複雑なメッセージのエンリッチメントを実行するシナリオの第 5 段階です。このトピックでは、ネスト化され、反復する複雑なメッセージをマップするためのメッセージ・フローおよびメッセージ・モデルを作成する方法について説明します。また、対応するインスタンス文書の作成についても説明します。
  1. ネーム・スペース「www.complex.net」内の COMPLEX メッセージ定義に、以下の構造を持つ addev3 というメッセージを作成します。
      addev3
       choice
          sstr (xsd:string) local element
          intrep (xsd:int) local element, minOcc=2, maxOcc=6
          dur (xsd:duration) local element
       choice
          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. MQInput > Mapping > MQOutput というマッピングを含む addev3 というメッセージ・フローを作成します。
  3. マップを開き、addev3 をソースおよびターゲットとして選択します。
  4. 以下のようにして、それぞれのソース・エレメントをそれに対応するターゲット・エレメントにマップします。
    sstr --- sstr
    intrep --- intrep
    dur --- dur
    dat1 --- dat1
    sval --- sval
    bool1 --- bool1
    dat2 --- dat2
    int1 --- int1
    dec1 --- dec1
    binel --- binel
    lelem --- lelem
    latt --- latt
    head --- head
    count --- count
    fstr --- fstr
    multel --- multel
    footer --- footer
    repstr --- repstr
  5. 「スプレッドシート」ペインで、最初の条件を fn:true() から fn:exists($source/comp:addev3/sstr) に変更します。
  6. 2 番目の条件を fn:true() から fn:exists($source/comp:addev3/intrep) に変更します。
  7. 3 番目の条件を fn:true() から fn:exists($source/comp:addev3/dur) に変更します。
  8. 最初の複合選択条件を fn:true() から fn:exists($source/comp:addev3/comp1) に変更します。
  9. 2 番目の複合選択条件を fn:true() から fn:exists($source/comp:addev3/comp2) に変更します。
  10. 3 番目の複合選択条件を 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>
以下のリソースが作成されました。
メッセージ・セットおよびメッセージ・フローをデプロイします。

メッセージ・セットおよびメッセージ・フローのデプロイ

これは、複雑なメッセージのエンリッチメントを実行するシナリオの第 6 段階です。このトピックでは、メッセージ・セットおよびメッセージ・フローをデプロイし、インスタンス・メッセージをブローカーで処理する方法について説明します。
  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 最終更新: 08/21/2006
ar25251_5_