Oracle8i Application Developer's Guide - XML Release 3 (8.1.7) Part Number A86030-01 |
Library | Service | Contents | Index

Phone Number Portability Using XML Messaging, 7 of 7

## Using Internet Message Studio (iMessage) to Create an Application Message Set

Internet Message Studio (iMessage) utility is used to define the message set of the Number Portability application or enterprise. It provides for an easy way to develop a message based application and generates all the necessary code to construct, publish, validate and process application messages.

It also enables sharing of messages between applications and prevents redefining the same message in various applications across the enterprise. The application can execute the generated procedures at run time for all its messaging needs. It also provides the necessary hooks or customization points for including business specific logic. Messages are generated using standard XML.

### Code Generation

For every message defined, the iMessage creates a package with the name of the message and the following procedures as part of the package.

- CREATE_MSG()

- SEND()

- PUBLISH()

- VALIDATE()

- PROCESS()

- DEFAULT_PROCESS()

### Defining Message Sets

Figure 12-1, "Using iMessage's Data Source Window to Define the Data Source for XML Message Elements (in Oracle Developer Forms)" shows how you can use iMessage to define an XML message. This screenshot also illustrates the XML message elements and structure as well as the associated source SQL query.

A number of steps are involved when using iMessage to define your XML message sets. These include the following:

- Defining Messages. Messages can be defined by specifying all the elements (attributes) and their structural relationships. Other constraints like mandatory or optional, maximum data length and default values can also be specified.

- Adding Message Details. The Type Field. The Internet Message Studio can also be used to define application events. The key difference between messages and events are that messages are used for communication between application systems and events can be used to broadcast or multi-cast state changes in business objects. In addition, the studio also helps to define timer messages.

  Events defined using the Internet Message Studio are published to both external and internal application systems. "Internal applications" can register a PL/SQL callback procedure via the "event Publisher" screens or the above defined API and will get executed when an event is published. "External Applications" by definition do not register callback procedures but will have an adapter running to relay the published event to the remote system. External applications can register for an event using the default subscribers screen. A good example for internal applications is Oracle's SDP and Installed Base running on a single Oracle instance.

- Description. The description provides the context in which the message will be used.

- Display Name. The Display Name is the descriptive name of the message.

- Adding Message Elements

- Building Message Structure. The structure of the message defines the hierarchical relationship of the message elements. Only predefined elements can be part of this hierarchy. Please refer to the user guide for more information on building the message structure. The message structure can be viewed as an inverted tree, with the root as the top most element.

- Root Element. By default the Internet Message Studio includes `MESSAGE' as a root element and the message being defined is the child of the root element. Please note that the root element is not visible and is implicitly defined by the Internet Message Studio. The root element should never be deleted. Elements not in the structure will not appear in the message.

- Defining Data Source. The next step in defining a message is to define the data source for message elements. Message elements can get their values from PL/SQL function calls and SQL queries. In addition, data can also be obtained as SDP Order parameters, SDP Work Item parameters or a Fulfillment Action parameters. See Table 12-1.

#### Figure 12-1 Using iMessage's Data Source Window to Define the Data Source for XML Message Elements (in Oracle Developer Forms)

Supported datatypes include

- PL/SQL Functions. A PL/SQL function can be executed at runtime to obtain the value of a message element. The specified PL/SQL function call can pass arguments by referring to any of the defined message elements. The PL/SQL function can also refer to any of the selected columns defined as a data source on some upper level message elements. The function should be specified in the source field of the user interface and the return type should be same as the type specified for the message element.

- SQL Queries. A SQL query can be used to derive data for the message elements. The columns in the SQL query can be used as a reference for other message elements provided those message elements are defined at a lower level in the tree hierarchy.

Other data types are SDP Order Parameters, SADP Work Item Parameters, and SDP Fulfilment Action Parameters.

| Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index