Installing the scenario

The first step is to set up eMatrix and create the eMatrix business object types.

Note:
%SAMPLE_FOLDER% refers to the folder in which you found this document.
%WBIA% refers to the folder containing your current WebSphere Business Integration Adapters installation.

Defining eMatrix business object types

First, you define the types which represent the parts of a computer system. To do this:

  1. Open the eMatrix MQL shell.
  2. Cut and paste the following commands into the shell:

    #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
    

Note that step 6 above gives the user "adapter" permission to perform all operations in the system. Not all these privileges are required to run this example. The following MQL command provides all those necessary:

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

However, if you use the eMatrix adapter for tasks not covered in these samples, you may need the privileges provided in step 6.

Creating eMatrix business object types

Next, you create the data that represents the computer system of the hypothetical computer manufacturer. To do this:

  1. Open the eMatrix MQL shell.
  2. Cut and paste the following commands into the shell:
    
    

    #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;
    

Installing the JPOs

You will need to install two JPOs, one to create the WBIA event and archive event types, and one to act as a trigger when detecting events.

  1. Open the eMatrix Business Modeler and log in as a user with the ability to create a program.
  2. Select Object>new>program.
  3. In the text box titled Name, enter WBIEventLogger.
  4. Choose Java for the Type.
  5. Click the Code tab.
  6. Cut and paste the code from the
    %WBIA%\connector\eMatrix\dependencies\WBIEventLogger.java file into the text box on this tab.
    You may need to set the 'wbiPrefix' and 'vault' values in the source code. Please review the comments in the code for more information.
  7. Click Create.

Follow the same steps to create the InstallEventTables program, with these differences:

Installing the triggers

In this section, you create a trigger which will detect when the hypothetical computer design changes. You create the trigger on the 'computer to pci component' relationship. To do this:

  1. In the eMatrix Business Modeler, click on the binoculars in the upper left-hand corner of the window.
  2. Select Relationship and click Find.
  3. Double-click the 'computer to pci component' business object.
  4. In the new window, select the Triggers tab and click Add.
  5. Select the Create trigger and click OK.
  6. In the new window, type WBIEventLogger in the Action text box.
  7. Type the following into the Input text box:
    -method recordEvent ${FROMOBJECTID} n=wbi_computer_poll v=Update
    
  8. Click OK, then click Edit to finish creating the trigger.

Installing the event business objects

The final step in installing the scenario is to install the event business objects. To do so, execute this command from the MQL command line:

exec program InstallEventTables;

Configuring the eMatrix adapter

The first step is to configure the eMatrix connector. To do this:

  1. Run the Connector Configurator.
  2. Open %SAMPLE_FOLDER%\EmatrixConnector.cfg and set these properties:
    RepositoryDirectory property = %SAMPLE_FOLDER%\repos
    PollFrequency property = key
    
  3. Set the ApplicationUserName and ApplicationPassword properties to the user on whose behalf the connector will be running.
  4. Set the eMatrixServer property to the name of the eMatrix server you will be connecting to.
  5. Set the HostName property to the URL, including the port, of the eMatrix collaboration server that the adapter will be communicating with.
  6. Set the EventVault property to the name of the vault which will store your events.
    You may create a new vault to store events. To do so, run the MQL eMatrix client and type 'add vault <vaultname>' in the text box at the bottom of the window. Make sure that the this value matches the value of the vault string in the WBIEventLogger JPO. By default both values should be 'WBI_Events'.
  7. Set the KeepRelations property to 'true'.
  8. Open %SAMPLE_FOLDER%\PortConnector.cfg and set these properties:
    RepositoryDirectory = %SAMPLE_FOLDER%\repos
    

Supporting business objects

For the adapter to use business objects, it must first support them. To provide support for the business objects you want to use, do this:

  1. With the Connector Configurator open, select the Supported Business Objects tab and add these business objects:

  2. Check the Agent supported box next to each business object.
  3. Repeat the steps above with the Port connector.

Creating queues

This sample scenario requires that several queues be defined in your queue manager. To create the necessary queues, type:

RUNMQSC crossworlds.queue.manager

from the command line and issue the following commands:

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")

Update the start script by opening either the start_eMatrix.bat or start_eMatrix.sh file (depending on your platform) and setting the EMADK and EM_LIB variables in these files.

Copyright IBM Corp. 1997, 2004