34 EAI DM Functions

Learn about the functions used by Oracle Communications Billing and Revenue Management (BRM) Enterprise Application Integration (EAI) Manager.

Topics in this document:

AbortTransaction

This function is called by the EAI DM after the transaction is cancelled in BRM. For transactional systems, the transaction started with the OpenTransaction function needs to be rolled back with this function.

Syntax

int 
AbortTransaction(
               void     *context);

Parameters

*context

A pointer to the context returned by the Initialize function.

Return Values

Returns PIN_RESULT_PASS if the operation is successful. Returns PIN_RESULT_FAIL if the operation fails.

CommitTransaction

This function is called by the EAI DM after BRM commits the transaction to its database. You commit the transaction opened to your system with this function.

Syntax

int 
CommitTransaction(
               void     *context);

Parameters

*context

A pointer to the context returned by the Initialize function.

Return Values

Returns PIN_RESULT_PASS if the operation is successful. Returns PIN_RESULT_FAIL if the operation fails.

Note:

Failure to commit to your system does not cancel the transaction within BRM.

FreeGlobalContext

This function is called when the EAI DM process is shutting down. All resources allocated by the InitializeGlobalContext function are freed with this function.

Syntax

void 
FreeGlobalContext(
               void     *gblContext);

Parameters

*gblContext

A pointer to the global context initialized by InitializeGlobalContext.

Return Values

This function returns nothing.

GetGlobalContext

This function is called from a connector application to access the context initialized with InitializeGlobalContext.

Syntax

void 
GetGlobalContext();

Parameters

This function has no parameters.

Return Values

This function returns nothing.

Initialize

This function is called by the EAI DM when it starts. This function performs all the initialization tasks such as resource allocations in this function implementation.

Note:

Initialize is called once for each EAI DM back end. The number of back ends is specified in the EAI DM pin.conf file.

Syntax

int 
Initialize(
               void     **context, 
               int       *output_type);

Parameters

**context

A pointer to an open context. context is a transparent Binary Large Object (BLOB) or cookie that is passed to the connector application during subsequent calls. You need to manage memory in your application for the context.

*output_type

Specifies the output format type: TYPE_XML or TYPE_FLIST. The format must match the value of the Format entry in the payloadconfig.xml file.

Return Values

Returns PIN_RESULT_PASS if the operation is successful. Returns PIN_RESULT_FAIL if the operation fails.

OpenTransaction

This function is called by the EAI DM before it calls the PublishEvent function. Open a transaction to your system during this call.

Syntax

int 
OpenTransaction(
               void     *context);

Parameters

*context

A pointer to the context returned by the Initialize function. You can save any transaction-specific information in the context.

Return Values

Returns PIN_RESULT_PASS if the operation is successful. Returns PIN_RESULT_FAIL if the operation fails.

PrepareCommit

This function is called by the EAI DM when BRM is about to commit the transaction to its database. If this function returns an error, the transaction within BRM is cancelled.

Syntax

int 
PrepareCommit(
               void     *context);

Parameters

*context

A pointer to the context returned by the Initialize function.

Return Values

Returns PIN_RESULT_PASS if the operation is successful. Returns PIN_RESULT_FAIL if the operation fails.

PublishEvent

This function is called by the EAI DM when there is a business event to be published. There could be more than one PublishEvent call during a single transaction.

Syntax

int 
PublishEvent(
               void     *context, 
               void     *payload, 
               char     *servicep);

Parameters

*context

A pointer to the context returned by the Initialize function.

*payload

A pointer to the event payload.

*servicep

A pointer to the service that was used to log in when this business event was generated. You can use this parameter to identify duplicate logins.

Return Values

Returns PIN_RESULT_PASS if the operation is successful. Returns PIN_RESULT_FAIL if the operation fails.

SetIdentifier

This function is called from the connector application to set a return identifier for a published business event. If an identifier is set when the event is published, the DM returns the identifier when it sends a response flist.

Syntax

void 
SetIdentifier(
               void     *identifier, 
               int       idLen);

Parameters

*identifier

A pointer to the identifier.

idLen

The length of the identifier.

Return Values

This function returns nothing.

Shutdown

This function is called by the EAI DM when it shuts down. You free all the resources allocated during initialization with this function.

Note:

To ensure an orderly shutdown and make sure that resources are reallocated, the connector application should send a SIGQUIT signal to the EAI_DM main process.

Syntax

void 
Shutdown(
               void     *context);

Parameters

*context

A pointer to the context returned by the Initialize function.

Return Values

This function returns nothing.