Building ODL acquisition AIMs  Building ODL delivery AIMs

Chapter 2: Developing ODL Applications

Setting up data formats

After the acquisition AIM receives all of the necessary data from the endpoint application, that data must be put into the format that the SFM expects from an incoming transaction. The SFM receives the transaction via one of several routing functions, which can send the data in a string or blob object. String and blob objects are ODL data classes.

  1. Build data objects for the arguments used by the routing function. Data objects are data variables defined using MSG-IDE or TRAN-IDE:

  2. Populate the data objects you built in the previous step. You can populate these data objects either before or in the same custom function from which you call the routing function.

    If the value for any of the data objects is the same for every transaction sent by the acquisition AIM, then you can populate the data objects once during the program’s initialization function, clinit(). Otherwise, populate the data objects with the correct values before each routing function call made by the program to the SFM. For example:

    int route_vrec(int [flavor] flavor, string [in] src, string [in] tranid, blob [in] data);int route_vprod(int [flavor] flavor, string [in] src, string [in] prodname, blob [in] data);int route_veng(int [flavor] flavor, string [in] src, string [in] engname, blob [in] data);int route_recx(int [flavor] flavor, string [in] src, string [in] tranid, blob [in] data, int [in] opts, char [in] priority, string [in] fkey, string [out] *serial, string [out] *errs, string [out] *status, string [out] *dests, string [out] *sfmName, int [out] *stmFlavor, string [out] *hostname);
    

Example

This example populates data objects for the route_vrec() routing function:

int rv;
int flav;
string src_ref;
string tranid;
blob dataBuf;
flav = 2;
src_ref = "acqaim1";
tranid = "tran1";
dataBuf = "this is my data";
rv = route_vrec(flv, src_ref, tranid, dataBuf);

where:

Return values

Table 2-1: DFC return values

Mnemonic

#

Description

RESERVED_FOR_DFCERR

-1

The cluster could not pass the transaction on to the SFM. Your program should call clGetDfcErrno() to troubleshoot the problem.

UNKNOWN_TRANCODE

-2

The SFM could not find the production name (route_vprod()) or the transaction ID name (route_vrec()) in its configuration file.

LOGFILE_FULL

-3

The SFM could not process the transaction because the log file was full.

TRAN_REFUSED

-5

The SFM refused the record because it is in refuse mode.

NOT_QUALIFIED

-6

The transaction data did not pass the field object validation or production object qualification checks in the referenced production object.

NO_DESTS

-7

There are no valid destinations for the production objects for which the transaction qualified. This occurs when the production objects uses the setDestName and/or the setDestNameData dynamic routing built-in filter functions to override the production object’s configured destinations but the built-in filter function did not specify a valid destination.

INVALID_DEST

-8

The SFM could not process the transaction because an invalid destination was specified with a dynamic routing built-in filter function.

Error handling

The errors list in Table 2-3 can be returned by DFCs:

Table 2-2: DFC errors

Error code

Description

4300

General DFC error.

4311

The DFC timed out while trying to acquire and instance of the DFC server.

4312

The DFC timed out while waiting for the server to pick up the message (message removed from server).

4313

The DFC timed out while the server was processing the message (message still in server).

4321

The DFC function/flavor combination was not found in the route map.

4322

The DFC function/flavor combination was unavailable due to the availability configuration.

4331

The DFC connection to the child controller could not be established.

4332

The DFC connection to the peer controller, remote cluster, or SFM could not be established.

4340

General DFC error in the server.

4350

General DFC error in the client bridge.





Copyright © 2005. Sybase Inc. All rights reserved. Building ODL delivery AIMs

View this book as PDF