Working with relationships

Once you have started Relationship Manager and connected it to an InterChange Server Express, you can use Relationship Manager to work with relationship data as described in the following sections.

Opening a relationship

Do the following to open a relationship definition in Relationship Manager after it is already connected to the server:

  1. Select File > Open from the menu bar of Relationship Manager.
  2. At the "Open Relationship" window, select the name of the relationship you want to open.

    Figure 48 shows the "Open Relationship" window.

    Figure 48. Opening a relationship
  3. Click OK.

    When you open a relationship, Relationship Manager displays the "retrieve relationships" window, described in Retrieving relationship instances.

Retrieving relationship instances

Select File > Retrieve Relationship from the menu bar of Relationship Manager to retrieve relationship instances or return a count of how many instances there are for a relationship. This displays the "retrieve relationships" window shown in

Figure 49 shows the "retrieve relationships" window.

Figure 49. Retrieving relationship instances

The "retrieve relationships" window is also displayed when you open a relationship or connect to InterChange Server Express and specify a relationship to open.

You can perform the following operations with the "retrieve relationships" window:

Depending on the number of participants in the relationship definition and the number of participant instances in each relationship instance, these retrieval queries may take some time.

Retrieving all instances

Do the following to retrieve the first 500 instances for a relationship:

  1. At the "retrieve relationships" window click Retrieve All.
  2. Click Get Relationships.

    Relationship Manager displays the first 500 instances for the relationship.

Retrieving by relationship ID

Do the following to retrieve a range of up to 500 instances:

  1. At the "retrieve relationships" window click Retrieve by ID.
  2. Type the id of the first instance in the range you want to retrieve in the From field.
  3. Type the id of the last instance in the range you want to retrieve in the To field.
  4. Click Get Relationships.

    Relationship Manager displays up to 500 instances in a range of the IDs you specify.

Retrieving by participant data

Do the following to retrieve a relationship instance based on values for key or nonkey attributes of selected participants:

  1. At the "retrieve relationships" window click Retrieve by Value.
  2. Select the participant whose value you want to search on from the Participants drop-down menu.

    For identity relationships, the drop-down menu lists the participant names followed by the business object definition with which the participant is associated.

    For lookup relationships, the drop-down menu lists the participant names followed by the word "Data".

  3. Type the one of the types of values listed in Table 21 in the Value column in the "Attributes" pane.

    Table 21. Supported values for retrieving relationship instances by participant data
    Value Description
    Participant data The data of the selected participant.

    For example, if the relationship is an identity relationship you would specify the id of the participant instance that you know to find the relationship instance in which it exists.

    If the relationship is a lookup relationship you would specify the non-key data value of the participant instance.

    %

    Any string of characters. This option is case-sensitive; numbers are included in the character set.

    For example, if %A were specified for a participant that stores abbreviated forms of the names of the United States, the values CA, GA, IA, LA, MA, PA, VA, and WA would be returned.

    _

    Any single character.

    As an example, _00 would retrieve 100, 200, a00, b00, and so forth.

  4. Click Get Relationships.

    Relationship Manager displays the first 500 relationship instances that match the specified value.

Returning a count of the relationship instances

To return the number of relationship instances that satisfy a retrieval criteria, select the options for the criteria as described in Retrieving all instances, Retrieving by relationship ID, or Retrieving by participant data, and then click Get Count instead of Get Relationships.

Creating relationship instances

Do the following to create a new instance for a relationship:

  1. Create the new relationship instance by performing any of the following tasks:

    Relationship Manager displays the new relationship instance.

    Highlighted at the top of the hierarchal relationship tree, on the entry line with the relationship icon is the placeholder for the relationship instance ID, which displays three question marks (???). Once you save the relationship instance or any of its participants, InterChange Server automatically generates the new relationship instance ID and Relationship Manager replaces the question marks with this instance ID.

  2. Expand the new relationship instance by clicking on the plus (+) sign next to the ??? placeholder icon.

    The relationship tree displays participant definitions, participant instances, and participant key and non-key attributes beneath the relationship instance in descending order.

  3. Do the following to create a new participant instance in the relationship instance:
    1. In the relationship tree, select the participant definition for which you want to create an instance.
    2. Do one of the following to add an instance for the participant:
      • Right-click a participant definition in the listing and choose Add Participant from the context menu.
      • Click Add Participant in the standard toolbar.
    3. Expand the new participant instance by clicking on the plus (+) sign next to it.
    4. Select the new participant instance.
    5. Click the Value column for the participant instance once, then type the desired value into the cell.
      Note:
      If the Value field for the attribute displays three question marks (???), the participant is managed by InterChange Server Express. You cannot enter values for these participants because InterChange Server Express automatically generates them when you save the relationship instance. The value is the same value as the relationship instance ID.

At this point, you can perform any of the tasks in Table 22.

Table 22. Tasks for Participant Data
Task Action
Save the participant instance. To save the new participant instance, right-click the participant instance and choose Save Participant from the context menu. Relationship Manager saves in the appropriate relationship table the data for this participant. The Modified column for the participant instances displays the date the participant was saved, which is the create date, in this case.
Note:
Once the participant data has been saved, it cannot be changed. To change its data, the participant must be deleted and another created.
Add more participant instances. Repeat repeat step 3 in the previous list.
Note:
If you are working with an identity relationship, you cannot create more than one participant instance for a participant definition.
Delete a participant. If necessary, you can delete a saved participant instance by right-clicking on the participant instance and choosing Delete Participant from the context menu. Relationship Manager removes the participant instance from the relationship table. If you do not want to remove the participant instance from the database, use the Deactivate Participant option (see Deactivating and activating participants). A deactivated participant retains its instance ID and its values.
Save the relationship instance. Save the relationship instance by performing one of the following tasks:
  • Select File > Save from the menu bar (activated when a relationship instance is selected).
  • Right-click the relationship instance and choose Save Relationship from the context menu.
InterChange Server Express generates the relationship instance ID and Relationship Manager replaces the placeholder with this new ID. Relationship Manager updates the modified date on all saved participant instances to this date.
Note:
At least one participant instance and all key attribute data must be created before the relationship instance can be saved.
Save all relationship instances. Select File > Save All from the menu bar. InterChange Server Express generates the relationship instance IDs for any relationship instances that do not have one. Relationship Manager replaces any "???" placeholders with the new IDs. Relationship Manager updates the modified date on all saved participant instances to this date.

Deleting relationship instances

To delete a relationship instance from the relationship tables, select the relationship instance you want to delete and perform one of the following actions:

The relationship instance and its data are deleted from the relationship tables for the current relationship.

Deactivating and activating participants

A participant instance can be deactivated, or made inactive. Deactivating a participant instance removes it from the relationship instance and prevents it from displaying in the Relationship Manager window, but its record remains in the relationship table so it can be re-activated in the future.

Deactivating a participant

To deactivate a participant instance, right-click the participant instance you want to deactivate and choose Deactivate Participant from the context menu. The participant is removed from the Relationship Manager display but not from the relationship tables.

Activating a participant

To activate a participant instance, take the following steps:

  1. Select View > Deactivated Participants from the menu bar.

    The Deactivated Participants window displays as shown in Figure 50.

    Figure 50. Deactivating participants
  2. Select the relationship instance that contains the deactivated participant you want to activate from the list.
  3. Expand this relationship instance until the deactivated participant instances display in the list.
  4. Right-click the participant instance to reactive and choose Activate from the context menu.
  5. Select Edit > Refresh from the menu bar.

    The activated participant instance displays in its relationship instance in the Relationship Manager window.

    Note:
    If a participant instance in an identity relationship is deactivated and another participant is added in its place (that is, assigned the same instance ID), the original participant is removed from the Deactivated Participants listing, but remains in the database.

Copying participants

You can create a new participant instance by copying an existing participant instance. To copy a participant instance, take the following steps:

  1. In the relationship instance, right-click the participant definition and choose Add Participant from the context menu.
  2. Right-click the participant instance you want to copy and choose Copy Participant from the context menu.
  3. Right-click the newly created participant instance and choose Paste Participant from the context menu.

Loading and unloading business object files

You can load a business object file of the same type into a participant. To load a business object data file into a participant, take the following steps:

  1. Right-click the participant instance where you want to load the business object file and choose Load Participant with Business Object.

    The Participant window displays the business object associated with that participant instance, as shown in Figure 51.

    Figure 51. Loading participants with business objects

  2. Select Participant > Load from the menu bar.
  3. Navigate to and open the business object file you want to load.
  4. Click OK.

Note:
Only the first instance of a relationship is loaded if more than one instance exists in the file.

Copyright IBM Corp. 2004, 2005