シナリオのインストール

最初に、eMatrix をセットアップし、eMatrix ビジネス・オブジェクト・タイプを作成します。

注:
%SAMPLE_FOLDER% は、本書が格納されているフォルダーを参照します。
%WBIA% は、現行の WebSphere Business Integration Adapters がインストールされているフォルダーを参照します。

eMatrix ビジネス・オブジェクト・タイプの定義

最初に、コンピューター・システムのパーツを表すタイプを定義します。これを行うには、以下のステップを実行します。

  1. eMatrix MQL シェルを開きます。
  2. 以下のコマンドを、シェルにカット・アンド・ペーストします。
    #BEGIN
     #1. create the attributes
     
     add attribute "component cost"                   type real;
     add attribute "in stock"                         type boolean;
     add attribute "date available"                   type date;
     add attribute "component manufacturer"           type string;
     add attribute megahertz                         type integer;
     add attribute slot                              type integer;
     
     #2. create the types 
     
     add type bundle;
     add type computer;
     add type cpu attribute "component cost" attribute "in stock" attribute 
     "date available"
     attribute "component manufacturer" attribute megahertz;
     add type "network card" attribute "component cost" attribute "in stock" 
     attribute "date available" attribute "component manufacturer";
     add type "usb 2.0 card" attribute "component cost" attribute "in stock" 
     attribute "date available" attribute "component manufacturer";
     add type "sound card" attribute "component cost" attribute "in stock" 
     attribute "date available" attribute "component manufacturer";
     add type "sound chip" attribute "component cost" attribute "in stock" 
     attribute "date available" attribute "component manufacturer" 
     attribute megahertz;
    #3. create the relationships
     add relationship "bundle to computer"' to type computer cardinality n from 
     type bundle cardinality n;
     add relationship "computer to pci component" to type "network card", 
     "sound card", "usb 2.0 card" cardinality n from type computer 
     cardinality 1 attribute slot;
     add relationship "sound card to sound chip" to type "sound chip" 
     cardinality 1 from type "sound card" cardinality 1;
    #4. create policy
     
     add policy "computer manufacturing" type bundle, computer, cpu, 
     "network card", "usb 2.0 card", "sound card", "sound chip" state 
     "pre production" state "ready for production";
     
     #5. create vault
     
     add vault "wbi computer manufacturer";
     #6. create the "adapter" person
     
     add person adapter password wbia type business, system access all admin all;
     
     #END

上述のステップ 6 では、システム内のすべての操作を実行する権限をユーザー "adapter" に与えています。この例を実行するために、これらの特権がすべて必要というわけではありません。以下の MQL コマンドは、必要な特権をすべて提供します。

add person adapter password wbia type business access all 
 admin none;

ただし、これらのサンプルで取り上げられていない作業のために eMatrix アダプターを使用する場合、ステップ 6 で提供される特権が必要となることがあります。

eMatrix ビジネス・オブジェクト・タイプの作成

次に、仮定上のコンピューター・メーカーのコンピューター・システムを表すデータを作成します。これを行うには、以下のステップを実行します。

  1. eMatrix MQL シェルを開きます。
  2. 以下のコマンドを、シェルにカット・アンド・ペーストします。
    
     
     
    #business objects
     add bus bundle "home office and entertainment" 1 
         policy                      "computer manufacturing" 
         vault                         "wbi computer manufacturer";
     add bus computer "gamer deluxe" 1 
         policy                      "computer manufacturing" 
         vault                         "wbi computer manufacturer";
     add bus cpu "max processor" 1 
         policy                      "computer manufacturing" 
         vault                       "wbi computer manufacturer"
         megahertz                     2000
         "in stock        "            true
         'date available    "     9/30/01
         "component manufacturer" acetech
         "component cost    "     67;
     add bus "sound card" "super sonic" 1 
         policy                      "computer manufacturing" 
         vault                       "wbi computer manufacturer"
         "in stock        "           false
         "date available"     6/12/03
         "component cost"     50
         "component manufacturer" "feedback inc.";   
     add bus "sound chip" "super sound chip" 1 
         policy                      "computer manufacturing" 
         vault                       "wbi computer manufacturer"
         "component manufacturer" ChipsWeMake
         megahertz                   100;
     add bus "usb 2.0 card" "usb enabler" 1 
         policy                      "computer manufacturing" 
         vault                       "wbi computer manufacturer"
         "in stock"    '           true
         "date available    "     2/10/02
         "component manufacturer" usbworks
         "component cost"     12;
     add bus "network card" "net connector" 1 
         policy                      "computer manufacturing" 
         vault                       "wbi computer manufacturer"
         "in stock        "            true
         "date available    "     8/12/02
         "component cost"'     10
         "component manufacturer" "tcp specialists"; 
     #relationships
     connect bus bundle "home office and entertainment" 1 relationship 
     "bundle to computer" to computer "gamer deluxe" 1;
     connect bus computer "gamer deluxe" 1 relationship "computer to pci component" 
     to "sound card" "super sonic" 1 
     slot 1;
     connect bus computer "gamer deluxe" 1 relationship "computer to pci component" 
     to "usb 2.0 card" "usb enable" 1 
     slot 2;
     connect bus "sound card" "super sonic" 1 relationship "sound card to 
     sound chip" to "sound chip" "super sound chip" 1;

JPO のインストール

2 つの JPO をインストールする必要があります。1 つは WebSphere Business Integration Server Express イベントを作成し、イベント・タイプを保存するためのもので、もう 1 つはイベント検出時にトリガーとして動作するものです。

  1. eMatrix Business Modeler を開き、プログラムを作成する権限を持つユーザーとしてログインします。
  2. 「オブジェクト」>「新規」>「プログラム (program)」を選択します。
  3. 「名前」というタイトルのテキスト・ボックスに WBIEventLogger と入力します。
  4. 「タイプ」「Java」を選択します。
  5. 「コード」タブをクリックします。
  6. コードを %WBIA%¥connector¥eMatrix¥dependencies¥WBIEventLogger.java ファイルからこのタブのテキスト・ボックスへカット・アンド・ペーストします。
    ソース・コードで wbiPrefix および vault の値の設定が必要な場合もあります。詳細については、コード中のコメントを調べてください。
  7. 「作成」をクリックします。

同じステップを実行して、InstallEventTables プログラムを実行します。ただし以下の点が異なります。

トリガーのインストール

このセクションでは、仮定上のコンピューター設計に変更があったこと検出するトリガーを作成します。'computer to pci component' 関係においてトリガーを作成します。これを行うには、以下のステップを実行します。

  1. eMatrix Business Modeler 内で、ウィンドウの左上の角にある双眼鏡をクリックします。
  2. 「関係」を選択し、「検索」をクリックします。
  3. 'computer to pci component' ビジネス・オブジェクトをダブルクリックします。
  4. 新規ウィンドウで、「トリガー (Triggers)」タブを選択し 、「追加」をクリックします。
  5. トリガーの「作成」を選択し、「OK」をクリックします。
  6. 新規ウィンドウで、「アクション」テキスト・ボックスに WBIEventLogger と入力します。
  7. 「入力」テキスト・ボックスに次のように入力します。
    -method recordEvent ${FROMOBJECTID} n=wbi_computer_poll v=Update
  8. 「OK」をクリックしてから、「編集」をクリックして、トリガーの作成を終了します。

イベント・ビジネス・オブジェクトのインストール

シナリオのインストールの最後のステップは、イベント・ビジネス・オブジェクトのインストールです。これを行うためには、MQL コマンド行から次のコマンドを実行します。

exec program InstallEventTables;

eMatrix アダプターの構成

最初に、eMatrix Connector を構成します。これを行うには、以下のステップを実行します。

  1. Connector Configurator Express を実行します。
  2. %SAMPLE_FOLDER%¥EmatrixConnector.cfg を開き、以下のプロパティーを設定します。
    RepositoryDirectory property = %SAMPLE_FOLDER%¥repos
     PollFrequency property = key
  3. ApplicationUserName および ApplicationPassword プロパティーを、コネクター実行の対象となるユーザーに設定します。
  4. eMatrixServer プロパティーを、接続先の eMatrix Server の名前に設定します。
  5. HostName プロパティーを、アダプターが通信する eMatrix コラボレーション・サーバーの URL (ポートを含む) に設定します。
  6. EventVault プロパティーを、イベントを保管するボールトの名前に設定します。
    イベントを保管する新規のボールトを作成することができます。これを行うためには、MQL eMatrix クライアントを実行し、ウィンドウ下部のテキスト・ボックスに 'add vault <vaultname>' と入力します。この値が WBIEventLogger JPO 内の vault ストリングの値と一致することを確認してください。デフォルトでは、どちらの値も 'WBI_Events' となります。
  7. KeepRelations プロパティーを 'true' に設定します。
  8. %SAMPLE_FOLDER%¥PortConnector.cfg を開き、以下のプロパティーを設定します。
    RepositoryDirectory = %SAMPLE_FOLDER%¥repos

ビジネス・オブジェクトのサポート

アダプターがビジネス・オブジェクトを使用するためには、まずビジネス・オブジェクトをサポートする必要があります。使用するビジネス・オブジェクトをサポートするには、以下のステップを実行します。

  1. Connector Configurator Express が開いた状態で、「サポートされているビジネス・オブジェクト」タブを選択して、以下のビジネス・オブジェクトを追加します。

  2. 各ビジネス・オブジェクトの横にある「サポートされているエージェント (Agent supported)」ボックスにチェックマークを付けます。
  3. ポート・コネクターで上述のステップを繰り返します。

キューの作成

このサンプル・シナリオでは、ご使用のキュー・マネージャー内でいくつかのキューを定義する必要があります。必要なキューを作成するには、コマンド行から

RUNMQSC crossworlds.queue.manager

と入力し、以下のコマンドを発行します。

DEFINE QL("ADMININQUEUE")
 DEFINE QL("ADMINOUTQUEUE")
 DEFINE QL("DELIVERYQUEUE")
 DEFINE QL("FAULTQUEUE")
 DEFINE QL("REQUESTQUEUE")
 DEFINE QL("RESPONSEQUEUE")
 DEFINE QL("EMATRIXCONNECTOR/RESPONSEQUEUE")
 DEFINE QL("SYNCHRONOUSREQUESTQUEUE")
 DEFINE QL("SYNCHRONOUSRESPONSEQUEUE")
 DEFINE QL("PORTCONNECTOR/SYNCHRONOUSREQUESTQUEUE")
 DEFINE QL("PORTCONNECTOR/SYNCHRONOUSRESPONSEQUEUE")

start_eMatrix.bat または start_eMatrix.sh ファイル (プラットフォームによって異なる) を開き、これらのファイル中で EMADK および EM_LIB 変数を設定して、始動スクリプトを更新します。

Copyright IBM Corp. 2004, 2005