This section describes the manual creation of a business object definition named Hello. If your integration broker is InterChange Server, this business object is used by the SampleHello collaboration, whose creation is described in the tutorial chapter of the Collaboration Development Guide.
Figure 29 illustrates the Hello business object definition that you can 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 displays the New Business Object dialog box. Figure 30 shows the version of the New Business Object dialog box you see if you are running Business Object Designer from System Manager. If you are not running Business Object Designer from System Manager, the Create in Project list is omitted from the dialog box.
Names are generally case-sensitive, so type the name exactly as shown here.
Business Object Designer displays the business object definition dialog box, 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,, Business Object Designer 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, their names appear in the Type list. 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 your integration broker is InterChange Server (ICS) and System Manager is running, then every business object definition in the Integration Component Library you are working from is automatically displayed in this list.
If your integration broker is a non-ICS broker (such as WebSphere MQ Integrator Broker) or you are using ICS but System Manager is not running, then the only way to add a business object definition as a child to another business object definition is to import that business object definition first into Business Object Designer by clicking File > Open From File.
These columns 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 Business object design.
This box specifies the maximum number of bytes available for this attribute's value.
This specifies the value to use if no other value is supplied for the attribute at run time.
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.
If your integration broker is InterChange Server, 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, type 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 check mark appears in the Key column) |
Leave the other columns blank and click theName column of the fourth row.
The third attribute, SpecialMessage, is a string.
If your integration broker is InterChange Server, 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, type 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 columns 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 the first (leftmost) column and drag the cursor up one row.
You must now specify the verbs that this Hello business object supports. 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 box to display the screen in which you specify the verbs. Figure 33 illustrates this tab.
Figure 33. General editing
tab
The business object supports the four default verbs--Create, Delete, Retrieve, and Update; they appear on the General tab by default. For the purposes of this tutorial, 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:
To delete each verb individually:
The row is selected.
You have finished the definition for the Hello business object. This is a good time to save your changes by clicking File > Save. 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.