Business Object API Features and Procedures

This chapter covers the following topics:

Business Object APIs Overview

Use the public business object APIs to perform operations on the seeded business objects. See: Business Objects Overview. Because business objects logically encapsulate specific areas of the Oracle Trading Community Architecture (TCA) data model, these types of business object API procedures let you directly manipulate TCA data:

Business objects can contain a hierarchy of embedded business objects, business structures, and granular entities. Even though you use business object APIs at the object level, that initial API call triggers subsequent business object or granular API calls down the hierarchy. For example, see: Granular Versus Business Object APIs.

Related Topics

Seeded Business Object APIs

Business Object API Features

Seeded Business Object APIs

Business object APIs are provided for every seeded business object. For details on each API, including description, PL/SQL procedure, parameters, and validations, see: Oracle Integration Repository. For information about what each API does with the corresponding business object's attributes, see: Business Object API Attributes Information Overview.

The seeded business object APIs are:

The seeded APIs have all four types of procedures: Create, Update, Save, and Get. See: Business Object API Features.

Note: Unlike the other seeded APIs, the Source System Management Business Object API does not create, update, save, or get a specific seeded business object. You use this API to create and maintain source system mappings for any business object. See: Source System Management Business Object API.

Related Topics

Business Object APIs Overview

Source System Management Business Object API

Source System Management (SSM) maintains mappings, or references, of records between source systems, for example between Oracle Trading Community Architecture and a legacy system, or between a data hub and a spoke system. See: Source System Management Overview, Oracle Trading Community Architecture Administration Guide.

The Source System Management Business Object API maps entire business objects, not specific granular entities, to their source systems. This table shows the root TCA entities for each business object or business structure, representing the transition link between entity SSM and business object SSM.

Business Object or Structure TCA Entity Table
Organization HZ_PARTIES
Person HZ_PARTIES
Party Site HZ_PARTY_SITES
Organization Contact HZ_ORG_CONTACTS
Customer Account HZ_CUST_ACCOUNTS
Customer Account Site HZ_CUST_ACCT_SITES_ALL
Customer Account Contact HZ_CUST_ACCOUNT_ROLES
Phone HZ_CONTACT_POINTS
Telex HZ_CONTACT_POINTS
E-Mail HZ_CONTACT_POINTS
Web HZ_CONTACT_POINTS
SMS HZ_CONTACT_POINTS
EDI HZ_CONTACT_POINTS
EFT HZ_CONTACT_POINTS
Location HZ_LOCATIONS
Person Contact Information HZ_PARTIES

Note: The Organization Customer and Person Customer business objects are not mapped to any TCA entities. Business object SSM support is not available for these business objects.

The Source System Management Business Object API procedures are:

For details on these procedures, including description, PL/SQL procedure, parameters, and validations, see: Source System Management Business Object, Oracle Integration Repository.

Related Topics

Seeded Business Object APIs

Business Object API Features

All business object API procedures of the same type share common features and functionality. See:

Business object API procedures of all types also share common return status and error handling.

Business Object API Return Status

The x_return_status output parameter provides the status of the API:

Business Object API Error Handling

Errors can occur at either the business object API level, or at the level of the embedded business object or granular API calls. For example, a business object has an embedded granular entity. When you use an API to update that business object, that initial call triggers a call to the appropriate granular API for the embedded entity. You can get errors from either API call.

Errors from the initial business object API call are reported in the usual way. Examples of errors include not entering mandatory embedded entities, or trying to create a business object that already exists.

Errors from embedded API calls, however, are propagated to the top business object API, which then provides you additional messages regarding the embedded business object, business structure, or granular entity that is the cause of the error. Because a business object can have multiple embedded items, with many levels, these messages help you determine the exact cause of the errors.

For example, you are trying to create a business object, which contains two embedded granular entities. One embedded entity cannot be created because a mandatory value is not passed, so an error message is provided specifying the missing value at the granular level. Another error message is provided at the business object level indicating in which embedded entity the attribute is missing.

Related Topics

API Overview

Business Object APIs Overview

Create Business Object API Procedures

Create business object API procedures create an instance of the particular business object in the database, returns the business object identifier to the caller, and provides information communicating the success of the operation. Create procedures are provided for every seeded business object. For details on specific procedures, see: Oracle Integration Repository.

If errors occur with the Create business object procedure call, then all parts of the call fail, including the API calls for embedded items. You cannot partially create a business object.

Any error that occurs in creating embedded items is propagated to the top business object level, and the creation of the entire object fails. See: Business Object API Error Handling.

Validations

Embedded Business Objects and Structures

In most cases, when you call a Create business object API procedure, the business object's embedded business objects and structures are also created, with their own Create business object API procedures called in a nested manner. In the single case where an existing Person business object can be used as an Organization Contact, when you use the Create Organization Contact Business Object API procedure, the Save Person Business Object API procedure is called to check that the person already exists. See: Save Business Object API Procedures.

Embedded Granular Entities

When you call a Create business object API procedure, corresponding granular APIs are called for embedded granular entities, depending on information, if any, that you pass to identify existing entities.

Related Topics

Business Object API Features

Business Object APIs Overview

Update Business Object API Procedures

Update business object API procedures modify a particular existing business object according to the provided values, returns the updated portions of the business object to the caller, and provides information communicating the success of the operation. Update procedures are provided for every seeded business object. For details on specific procedures, see: Oracle Integration Repository.

If errors occur with the Update business object procedure call, then all parts of the call fail, including the API calls for embedded items. You cannot partially update a business object.

Any error that occurs in creating or updating embedded items is propagated to the top business object level, and the update of the entire object fails. See: Business Object API Error Handling.

Validations

You must pass either a TCA identifier or a combination of source system and source system reference, or both, to identify the existing business object to update. This table describes the Update procedure behavior depending on the passed information.

TCA ID Passed TCA ID Valid Source System and Source System Reference Passed Passed Source System Information Matches Existing Mapping TCA ID and Source System Information Map to Each Other API Procedure Behavior
No   Yes Yes   Updates business object
No   Yes No   Fails with invalid identification error
Yes Yes No     Updates business object
Yes No       Fails with invalid identification error
Yes Yes Yes Yes Yes Updates business object
Yes Yes Yes Yes No Fails with invalid identification error
Yes Yes Yes No   Fails with invalid identification error

Embedded Business Objects and Structures

When you call an Update business object API procedure, the business object's embedded business objects and structures are either updated or created, with their own Save business object API procedures called in a nested manner. The Save procedure is called because:

See: Save Business Object API Procedures.

Embedded Granular Entities

When you call an Update business object API procedure, corresponding granular APIs are called to create or update embedded granular entities, based on information, if any, that you pass to identify existing entities.

If you pass a valid TCA identifier for the entity, then the entity is updated. If the ID is invalid, then the granular API call returns an error. If you do not pass any TCA identifier, then one of two checks occur:

Related Topics

Business Object API Features

Business Object APIs Overview

Save Business Object API Procedures

Save business object API procedures are essentially logical wrappings of both Create and Update API procedures for the same business object. For details on specific Save procedures, see: Oracle Integration Repository.

The Save procedure calls either the Create or Update procedure:

Validations

You must pass either a TCA identifier or a combination of source system and source system reference, or both, to identify the existing business object to update. This table describes the Save procedure behavior depending on the passed information.

TCA ID Passed TCA ID Valid Source System and Source System Reference Passed Passed Source System Information Matches Existing Mapping TCA ID and Source System Information Map to Each Other API Procedure Behavior
No   No     Creates business object
No   Yes Yes   Updates business object
No   Yes No   Fails with invalid identification error
Yes Yes No     Updates business object
Yes No       Fails with invalid identification error
Yes Yes Yes Yes Yes Updates business object
Yes Yes Yes Yes No Fails with invalid identification error
Yes Yes Yes No No Fails with invalid identification error

Related Topics

Business Object API Features

Business Object APIs Overview

Get Business Object API Procedures

Two types of Get business object API procedures are available:

For details on specific procedures, see: Oracle Integration Repository.

Related Topics

Business Object API Features

Business Object APIs Overview

Event Independent Get Procedures

Provided for each of the seeded business objects, these procedures retrieve and return business objects, recursively traversing down the business object's hierarchy, gathering the embedded objects, structures, and entities, to provide a complete, packaged business object. The returned object is a wrapping around data structures representing all of the business object's embedded items.

Validations

You must pass either a TCA identifier or a combination of source system and source system reference, or both, to identify the existing business object to extract. This table describes the Get procedure behavior depending on the passed information.

TCA ID Passed TCA ID Valid Source System and Source System Reference Passed Passed Source System Information Matches Existing Mapping TCA ID and Source System Information Map to Each Other API Procedure Behavior
No   Yes Yes   Gets business object
No   Yes No   Fails with invalid identification error
Yes Yes No     Gets business object
Yes No       Fails with invalid identification error
Yes Yes Yes Yes Yes Gets business object
Yes Yes Yes Yes No Fails with invalid identification error
Yes Yes Yes No   Fails with invalid identification error

Related Topics

Get Business Object API Procedures

Event Dependent Get Procedures

Provided for the seeded Organization Customer, Person Customer, Organization, and Person business objects, these procedures are affiliated with each seeded Create or Update business event for these objects. See: <link to business events overview>.

For each event, the corresponding Get procedure returns, to the event subscriber in one API call, all the business objects that the single business object affects:

For example, when an Organization business object is created, a corresponding Create Organization business event is raised to event subscribers, and the Get Created Organization Business Object API procedure returns the new Organization business object to the subscribers.

Note: The Event Dependent procedures are specifically used only in the context of business object business events. Do not use them otherwise.

These procedures allow systems to retrieve business objects as soon as the business object data is created or updated. Subscribing parties must be able to act on a business event by receiving the created or updated business objects.

Event Dependent Extraction Process

The event dependent business object extraction process involves different types of Event Dependent procedures:

  1. Even though one business event can involve multiple business objects, the event passes a single numeric event identifier to the event subscriber. This ID is then passed to the corresponding Get Business Object IDs procedure and used as a key to access a tracking table, to determine the affected object data for the business event. Given the passed business event ID, the procedure extracts an array of business object IDs.

    Important: The business event identifier passed to the Get Business Object IDs procedure must be valid for the business object. An error occurs if the passed ID is not found in the tracking table or is not valid for the business object.

    Get Business Object IDs procedures are provided for the Create and Update business events for Organization Customer, Person Customer, Organization, and Person business objects. For example, if the business event is that an Organization business object is created or updated, then either the Get Created Organization Business Object ID or Get Updated Organization Business Object ID procedure is called, respectively.

  2. With business object identifiers extracted by the Get Business Object IDs procedure, another procedure is called next to retrieve each of the business objects in the array of IDs. One procedure is called for each ID in the array, with the business event and object IDs passed in, depending on the type of business event.

    • Create Business Event: The corresponding Event Independent Get procedure is called. See: Event Independent Get Procedures.

    • Update Business Event: The corresponding Get Updated Business Object procedure is called to extract not only the business object data, but also indicators that define which pieces of data has changed. See: Get Updated Business Object Procedures.

      An error occurs if you attempt to get an updated business object by passing a business event ID and business object ID, but the object was not updated as part of that event.

Alternatively, you can combine these two steps and use the Get Business Object Data in Bulk procedure. As essentially a wrapping of the Get Business Object IDs procedures and the appropriate procedures to retrieve business object data, the Get Business Object Data in Bulk:

  1. Receives the single business event identifier from the business event and retrieves an array of business object IDs.

  2. For each business object ID in the array, calls the appropriate Event Independent or Get Updated Business Object procedure and adds the created or updated business object to a table.

  3. Returns the table of objects to the caller.

Get Updated Business Object Procedures

Get Updated Business Object procedures are provided for the Update business events for Organization Customer, Person Customers, Organization, and Person business objects. See: Event Dependent Extraction Process.

These procedures extract the entire updated business object, for a specific Update business event. By returning an action type, the procedure also specifies how the business object's root level attributes, as well as the object's embedded items, have changed as a result of the Update business event. See: Business Object Attributes and Business Object Embedded Items.

Note: The procedures provide action types for business objects, business structures, and embedded granular entities at any level of the top business object's hierarchy, except at the root business object level for Organization Customer and Person Customer business objects.

This table describes what each action type means for business objects or structures, at any level of the business object hierarchy, and embedded entities. If an action type indicates that the business object or structure has new or updated embedded items, as a result of the Update business event, you refer to the action type for that embedded item to determine what happened.

Action Type Meaning for Business Object or Structure Meaning for Granular Entity
CHILD_UPDATED
  • Business object or structure attributes were not updated.

  • At least one embedded item was created or updated.

Not used.
CREATED
  • Business object or structure attributes were created.

  • Any embedded items were created.

Attributes of the embedded entity were created.
UPDATED
  • Business object or structure attributes were updated.

  • One or more embedded items might have been created or updated.

Attributes of the embedded entity were updated.
UNCHANGED No changes were made to business object or structure attributes, nor to any of the embedded items. No changes were made to attributes of the embedded entity.

Action Type Example

This example illustrates the action types that are returned based on the changes made as a result of a specific Update business event. For this example, an Organization business object with ID of 1200 has this hierarchy:

Phone Business Object Added to Organization Contact Business Object

If a Phone business object with ID 321 is added to the Organization Contact business object 98, within Organization business object 1200, then an Organization Updated business event is raised. The Get Updated Organization Business Object procedure would return Organization object 1200 with the following action types.

Organization Business Object Attributes Updated

If root level attributes of Organization business object 1200 are updated, then an Organization Updated business event is raised. The Get Updated Organization Business Object procedure would return Organization Object 1200 with the following action types.

Location Business Structure Updated and Contact Preference Added

If, within Organization business object 1200, the Location business structure 11 is updated, and Contact Preference entity 117 is added to Phone business object 321, then an Organization Updated business event is raised. The Get Updated Organization Business Object procedure would return Organization object 1200 with the following action types.

Related Topics

Get Business Object API Procedures