The first step is to set up eMatrix and create the eMatrix business object types.
First, you define the types which represent the parts of a computer system. To do this:
#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.
Next, you create the data that represents the computer system of the hypothetical computer manufacturer. To do this:
#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;
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.
Follow the same steps to create the InstallEventTables program, with these differences:
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:
-method recordEvent ${FROMOBJECTID} n=wbi_computer_poll v=Update
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;
The first step is to configure the eMatrix connector. To do this:
RepositoryDirectory property = %SAMPLE_FOLDER%\repos PollFrequency property = key
RepositoryDirectory = %SAMPLE_FOLDER%\repos
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:
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.