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

マッピング・シナリオ D で使用するために、ネストされ、反復する複雑なメッセージをマップするためのメッセージ・フローおよびメッセージ・モデルを作成し、対応するインスタンス文書を作成します。このシナリオでは、複雑なメッセージのエンリッチメントについて説明されています。

始める前に
このステップは、シナリオ D: 複雑なメッセージのエンリッチメントを作成するための 5 番目の作業です。
  1. COMPLEX メッセージ定義のネーム・スペース www.complex.net に、以下の構造を持つ 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. Mapping ノードのマップを開き、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. メッセージ・マッピング・エディター「スプレッドシート」ペインで、if ステートメントを fn:true() から fn:exists($source/comp:addev3/sstr) に変更します。
  6. elseif ステートメントを fn:true() から fn:exists($source/comp:addev3/intrep) に変更します。
  7. 2 番目のelseif ステートメントを fn:true() から fn:exists($source/comp:addev3/dur) に変更します。
  8. 最初の複合選択 if ステートメントを、fn:true() から fn:exists($source/comp:addev3/comp1) に変更します。
  9. 2 番目の複合選択 elseif ステートメントを、fn:true() から fn:exists($source/comp:addev3/comp2) に変更します。
  10. 3 番目の複合選択 elseif ステートメントを、fn:true() から fn:exists($source/comp:addev3/comprep) に変更します。
  11. 適切な MQRFH2 ヘッダーを持つ、以下のインスタンス・メッセージを作成します。
    <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>
以下のリソースが作成されました。
メッセージ・セットおよびメッセージ・フローをデプロイします。

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

このステップは、シナリオ D: 複雑なメッセージのエンリッチメントを作成するための 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, 2012Copyright IBM Corporation 1999, 2012.

        
        最終更新
        
        最終更新 : 2012-08-03 11:56:08


タスク・トピックタスク・トピック | バージョン 7.0.0.5 | ar25251_5_