There are two ways to create a business object definition:
This section describes the manual creation of a business object definition named Hello. This business object is used by the SampleHello collaboration.
Figure 29 illustrates the Hello business object definition that you will create and shows the values that its integration broker might expect from its triggering-event business object.
Figure 29. Hello business object.
To create a business object definition manually:
Business Object Designer Express displays the New Business Object dialog. Figure 30 shows the version of the New Business Object Dialog you see if you are running Business Object Designer Express from System Manager. If you are not running Business Object Designer Express from System Manager, the Create in Project: field is omitted from the dialog.
Names are generally case-sensitive, so enter the name exactly as shown here.
Business Object Designer Express displays the business object definition dialog, as illustrated in Figure 31.
Figure 31. Initial display of a new business object definition.
Each piece of information in the business object is represented by an attribute in the Hello business object definition. You must provide the attribute definitions for the Hello business object. As illustrated in Figure 31, the tool automatically adds an entry for the required "end of object" marker, ObjectEventId.
Important |
---|
Do not delete, change, or move the ObjectEventId attribute. This attribute is reserved for the WebSphere business integration system's internal use. Business Object Designer automatically moves this attribute when you save the definition. |
The row for each attribute defines the attribute's properties. For information on the attribute properties, see Business object attributes and attribute properties.
As Figure 29 shows, the Hello business object definition has the following attributes: Greeting, Recipient, and SpecialMessage. Define the attributes and their properties, one at a time.
To add the Greeting attribute:
If you have other business objects opened in Business Object Designer Express, their names appear in the Type pull-down menu. Displaying existing business objects among the choices for Type allows you to create a hierarchical business object with an attribute whose type is another business object.
If System Manager is running, then every business object definition in the Integration Component Library you are working from is automatically displayed in this list.
These fields specify whether the current attribute is the business object's primary or foreign key, whether the attribute's value is required, and whether the attribute represents a child business object or objects. For an explanation of these properties, see Designing business objects.
This field specifies the maximum number of bytes available for this attribute's value.
This field specifies the value to use if no other value is supplied for the attribute at runtime.
You have now defined the following properties for the Greeting
attribute:
Name: |
Greeting |
Type: |
String |
Maximum length: |
255 |
Default value: |
Hello |
The second attribute, Recipient, is a string.
The SampleHello collaboration object uses this attribute as follows:
At least one attribute in each business object definition must be a key attribute. A key attribute contains a value by which the WebSphere business integration system uniquely identifies instances of the business object. Make the Recipient attribute the key attribute.
To add the Recipient attribute, enter the text
Recipient in the Name column, and follow the steps for adding the
Greeting attribute, using the following properties:
Name: |
Recipient |
Type: |
String |
Maximum length: |
255 |
Default value: |
Collaboration |
Key: | Yes
(A checkmark appears in the Key column) |
Leave the other fields blank and click in the Name column of the fourth row.
The third attribute, SpecialMessage, is a string.
The SampleHello collaboration expects the value of this attribute to be entered by the system administrator or another person with access to the collaboration configuration properties after the collaboration object has been created. The collaboration dynamically obtains the value of the configuration property and appends it to the message.
To add the SpecialMessage attribute, enter the text
SpecialMessage in the Name column, and follow the steps for adding
the Greeting attribute, using the following properties
Name: |
SpecialMessage |
Type: |
String |
Maximum length: |
255 |
Leave the other fields blank.
The Attributes tab now displays three user-defined attributes: Greeting, Recipient, and SpecialMessage. Figure 32 illustrates the Hello business object's attributes.
Figure 32. New business object definition with attributes.
You can graphically change the sequence order of attributes in the business object definition. For example, to place the key attribute, Recipient, above the Greeting attribute, click in the first (leftmost) column and drag the cursor up one row.
You must now specify the verbs that this Hello business object will support. These verbs represent the triggering events that the business object sends to the integration broker. Click the General tab of the Hello business object definition dialog to display the screen in which you specify the verbs. Figure 33 illustrates this dialog.
Figure 33. General editing screen
The business object supports the four default verbs--Create, Delete, Retrieve, and Update--and they appear by default. In this example, only one triggering event is supported: Create. Therefore, change the business object definition to support only this verb.
To indicate that the Hello business object supports only the Create verb, you can either delete the remaining verbs simultaneously or individually.
To delete the Delete, Retrieve, and Update verbs simultaneously:
To delete each verb individually:
The row becomes highlighted.
You have finished the definition for the Hello business object. This is a good time to save your changes by selecting File > Save from the menu bar. If you are using an ICL-based project, the definition is saved to the ICL. If you are using a local project, you will be prompted to specify a file name and local directory in which to save the definition.
This section describes how to create a hierarchical business object definition by defining an attribute that represents a child business object or an array of child business objects.
Because the previous section explains how to define a simple attribute and supported verbs, this section explains only the definition of an attribute that represents a child business object. This example creates a business object named HierarchicalBO that has two attributes:
To manually create a hierarchical business object definition:
Business Object Designer Express displays the New Business Object dialog, as illustrated in Figure 30.
Business Object Designer Express displays the business object definition dialog, as illustrated in Figure 31.