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.
Build data objects for the arguments used by the routing function. Data objects are data variables defined using MSG-IDE or TRAN-IDE:
int flv
string src_ref
string tranid – used only with route_vrec().
string prodname – used only with route_vprod().
string databuf or blob databuf
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);
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:
flv – is the flavor of the SFM that should receive the data.
src_ref – is a reference name for the acquisition AIM.
tranid – is the transaction ID reference.
databuf – is the data to send. In this example, name, address, and number are the defined data objects.
The main controller that contains the SFM and ODL applications always returns a negative value to your acquisition AIM if it encounters a problem of some kind. If the return value is -1, it calls the clGetDfcErrno() function.
If the e-Biz Impact cluster does not find an error, it returns whatever value the SFM sets as the return value.
After the program issues a DFC command, to send or receive data, it should:
Check the return value for a negative value. If the return value is not a negative value, check for your programmed return values, if any.
If the return value is a negative value, check for one of the following conditions. Check for the integer value or for the mnemonic that is associated with the integer as listed in Table 2-2.
The errors list in Table 2-3 can be returned by DFCs:
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |