< Previous | Next >

Adding roles and key attributes

You have created a relationship. Now, you will add three roles and key attributes for them.

The first role is called the GenericCustomer role. All customers will have the attributes specified for this role. Generic roles like GenericCustomer role are identified as managed roles. This task shows how to specify a managed role.

To create the GenericCustomer role:

  1. Click the Add Role button Image of add role button. The Data Type Selection window opens.
  2. In the Filter by type, namespace, or file (? = any character, * = any String) field, type CustomerBO.
  3. Select CustomerBO from the list of matching data types.
  4. Click http://eMergedLibrary/com/emerged/portal - eMergedLibrary/com/emerged/portal/CustomerBO.xsd as the qualifier.
    Image of the Data Type Selection window showing fields completed as described in the text
  5. Click OK. The CustomerRelationship_CustomerBO role is created.
  6. Scroll down to the Properties view, where you will rename the role and define it as a managed role.
  7. On the left side of the Properties view, click the Description tab.
  8. To replace the generated name, in the Name field, type GenericCustomer. For this exercise, do not refactor.
  9. Click the Details tab. Because Synchronize with the name field is selected, the display name is updated automatically.
  10. Select the Managed check box.
  11. From the menu, click File > Save or press Ctrl+S.
You now have a role called GenericCustomer. The role has an error flag, because it requires a key attribute. You will create that attribute next.

Adding the key attribute for GenericCustomer

Now, you can add the key attribute to the GenericCustomer role.

The managed role of the identity relationship must have only one key attribute defined; there are no combined keys allowed for the managed role.
  1. Switch to the CustomerRelationship editor at the top of the screen and select the GenericCustomer role.
  2. Click the Add Key Attribute button Image of the Add KeyAttribute button. The Select Key Attributes window opens.
  3. From the table, select customerNumber.
    Image of the Select Key Attributes window with customerNumber selected
  4. Click OK.
  5. Save your work. The error marker should vanish from the role artifact in the CustomerRelationship editor.

Creating the BankCustomer role

You have created the generic customer role. Now, you will create the specific bank customer role, called BankCustomer. Then, you will specify the attributes of the bank customer role.

Create the bank customer role by repeating the steps you used to create the generic customer role, but this time select the qualifier http://BankModule/com/emerged/bank - BankModule/com/emerged/bank/CustomerBO.xsd, which points to BankModule instead of to the eMerged library. Name this role BankCustomer.
Image of the Data Type Selection window showing fields completed as described in the text

Adding the key attribute for BankCustomer

  1. Switch to the CustomerRelationship editor.
  2. Select the BankCustomer role and add the customerNumber key attribute to the that role by following the steps you used to add a key attribute to the GenericCustomer role.
  3. Save your work.
The editor in your workspace should now contain two roles:
Image of the CustomerRelation editor with two roles

Creating the BrokerageCustomer role

You need one more role. It is called BrokerageCustomer.

Create the bank customer role by repeating the steps you used to create the generic customer role, but this time select the qualifier http://BrokerageModule/com/emerged/brokerage - BrokerageModule/com/emerged/brokerage/CustomerBO.xsd, which points to BrokerageModule. Name this role BrokerageCustomer.

Adding the key attribute for BrokerageCustomer

  1. Switch to the CustomerRelationship editor at the top of the screen.
  2. Select the BrokerageCustomer role and add the customerNumber key attribute to the that role by following the steps you used to add a key attribute to the GenericCustomer role.
  3. Save your work.
  4. From the menu, select File > Close (or press Ctrl+F4).The editor closes for CustomerRelationship.
You now have three roles, each of which uses customerNumber as a key attribute. You are now ready to add the relationship to business object maps.

Feedback
(C) Copyright IBM Corporation 2005, 2006. All Rights Reserved.
< Previous | Next >