A business object is a container for application data,
such as a customer or an invoice. The underlying structure of a business
object is an XML schema definition (XSD).
If you want to use existing XSDs you can import them into
the workspace using File > Import. Business
objects are automatically created for the XSDs and you can map them
in the XML map editor. In this sample, you create the business objects.
To create the business objects for this sample, follow
these steps:
- In the Business Integration view, within the HelloWorldDataPowerLibrary, right-click the Data category and select New > Business Object. The New Business Object wizard opens.
- In the Name field, enter fullname.
- Select the option Create the business object
as an element.
- Click Finish. The Business Object
editor opens.
- Add a source business object by clicking the Add a field
to a business object icon in the local toolbar (or right-click
the fullname box and select Add
Field):
- Type over the generated field's name of field1 and replace it with title. If the name is
not selected, then first click on it to select it.
- Repeat the previous step to create two more fields; one
named firstName and the other named lastName. The final business object should look like
this: Optional: Select one of the string cells in the Type column. A list of types appears. Although you only
need fields of type string for this sample,
this is where you can specify other types. Press the Esc key to close the list.
Optional: Select a field
and look at the Properties view below the editor.
Although you do not need to set any of these fields for this sample,
this is where you can specify certain properties for fields, such
as specifying field repetition or maximum length.
- Press Ctrl-S to save your work,
and then close the business object editor.
Optional: Under the covers, you have just created a new
XSD or XML schema file with a complex type in it. If you are curious,
you can see the file by right-clicking the FullName business object
and selecting Open With > XML Schema Editor, then choosing the Source tab.
- Repeat the procedure starting with Step 1 to create another
business object named title_firstname_lastname.
- Add a single field of type string to the business object
and call the field name.
- Save and close the business object editor.