The connector uses message family-specific stored procedures for
application event object processing and message type-specific stored
procedures for service call request processing.
The following sections describe these methods.
The connector uses the appropriate GETNXT-stored procedure to retrieve
events from the message family staging tables. The signature for the
GETNXT procedure varies from one message family to another.
The typical GETNXT-stored procedure call looks like this:
PROCEDURE GETNXT( O_status_code OUT VARCHAR2,
O_error_text OUT VARCHAR2,
O_message_type OUT VARCHAR2,
O_message OUT CLOB,
O_msg_1
...
);
O_status_code -- Denotes the status of the call, which may
be one of four values:
- MFM_FATAL_ERROR--The message cannot be retrieved due to an
error. The publisher should exit.
- MFM_WARNING--The next message cannot be published because of a
sequencing problem.
- MFM_SUCCESS--The message was retrieved successfully.
- MFM_NO_MSG--No messages are waiting to be put onto the integration
bus.
O_error_text--The text associated with an error or
warning.
O_message_type--The type of the message payload. A
specific type is associated with one or more business events.
O_message--The message payload formatted as an XML
string.
O_msg_1-- Additional optional message family-specific
parameters.
- Note:
- The status code, error text, message type, and message payload are common to
all procedures but can be followed by a number of message family-specific
output parameters, which need to be placed in the ID or routing fields of the
Retek Message Header business object. Occasionally, input parameters
may be present as well. For more information on message family-specific
metaobjects, see "Specifying Retek metadata business objects".
The connector performs the following steps:
- Uses the message family metadata business object passed in during
instantiation to prepare a statement for the GETNXT call:
- Registers local variables for the first 4 common output parameters (status
code, error text, message type, and message payload).
- Maps the message family-specific attributes in the GETNXT metaobject to
the corresponding parameters of the GETNXT-stored procedure.
- Calls the GETNXT procedure to retrieve message data; the message
family metadata business object attributes that correspond to output
parameters are populated by GETNXT.
- Creates a business object as follows:
- If the BOSupportMode flag is set to Generic, creates a generic
business object using the retrieved XML message to populate the message
attribute.
- If the BOSupportMode flag is not set to Generic and there is a
business object definition corresponding to the payload in the list of
supported business objects, invokes the XML data handler to retrieve the
message-specific business object with all payload attributes populated.
- If the BOSupportMode flag is set to "Message-specific," considers it an
error.
- If the BOSupportMode flag is set to "Mixed," creates a generic business
object using the retrieved XML message to populate the message
attribute.
- Instantiates a Retek Message Header business object and populates the ID
and routingInfo attributes based on the information retrieved in the message
family metadata business object. For more information related to this
step, see "Specifying Retek metadata business objects".
- Sets the value of the source attribute to this connector
instance name.
- Assigns the Retek Message Header business object to the corresponding
child business object of the created message business object.
- Sets the verb as described in "Retek business object verbs".
- For a generic business object sets the ID attribute of the header as
follows:
- Retrieves the KeyMO metaobject, if one was configured.
- For all attributes marked as keys in the metaobject (family, type, and/or
ID), adds the value of the corresponding attribute in the header to the ID, as
follows:
- Delivers the Retek message business object to the broker by calling
gotApplEvent.
For a summary of the status and error information related to the
GETNXT-stored procedure, see Overview of the connector.
The CONSUME message family type-specific stored procedure is used to
perform incoming message processing (service call requests). The
connector's business object handler's doVerbFor method invokes the
message family type-specific CONSUME stored procedure to process the business
object it receives as input.
The typical CONSUME-stored procedure call looks like this:
PROCEDURE CONSUME(O_status_code IN OUT VARCHAR2,
O_error_message OUT VARCHAR2,
I_message IN OUT CLOB);
O_status_code--Denotes the status of the call, which may
be one of the following values:
- SUB_FATAL_ERROR - A fatal error was encountered processing the
payload.
- SUB_XML_PARSE_ERROR - The payload could not be parsed due to a validation
error.
- SUB_SUCCESS - The payload was processed successfully.
O_error_message--The text associated with any error
condition.
I_message--The payload XML text used as input to the
stored procedure.
- Note:
- The status code, error text, and message payload parameters are common to all
procedures, but can be followed by a number of application-specific input
parameters.
Example: For RDM there is a fourth parameter called
facility_type.
The procedure takes place as follows:
- The connector receives a Retek message business object as input.
- If the message business object is generic, the connector retrieves the XML
payload from the business object.
If the message business object is message-specific, the connector calls the
XML data handler, passing in the message-specific business object and gets
back the corresponding XML as output.
- The business object handler constructs the name of the CONSUME API as
follows:
<app_name>SUB_<message_type>.CONSUME
<app_name>--The name of the application being
serviced by this instance, per AppName property.
<message_type>--The message type, from the message
type attribute of the Retek message business object.
- The business object handler builds the SQL statement for the CONSUME call
as follows:
- Uses local variables to register the error code and error message.
- Builds a clob object from the XML payload and registers it for the
message parameter.
- Retrieves any other input parameters for the CONSUME call. The
ConsumeMO metaobject must contain attributes for all extra input parameters in
the order they appear in the CONSUME-stored procedure. For more
information on the ConsumeMO metaobject, see "Specifying Retek metadata business objects".
- For each attribute in the CONSUME metaobject:
It looks for a routing field with the same name as the attribute in the
Retek Message Header; if found, it sets the attribute value to the value
of the routing field. In cases where the header does not contain the
appropriate routing field, it uses the default value of the attribute.
It registers the attribute as the next input parameter for the SQL
statement.
- The business object handler calls the CONSUME API to process the
message.
Results: One of the following occurs:
