cciRegisterUserExit
cciRegisterUserExit is a utility function that can be called by the user's code when bipInitializeUserExits is called.
This function is called by the user's code if the user wants to register functions to be called every time certain events occur.
Syntax
typedef struct cci_UEVft {
int reserved;
char StrucId[4];
int Version;
cciInputMessageCallback iFpInputMessageCallback;
cciTransactionEventCallback iFpTransactionEventCallback;
cciPropagatedMessageCallback iFpPropagatedMessageCallback;
cciNodeCompletionCallback iFpNodeCompletionCallback;
cciOutputMessageCallback iFpOutputMessageCallback;
} CCI_UE_VFT;
void cciRegisterUserExit (
int* returnCode,
CciChar* name,
CciDataContext* userContext,
CCI_UE_VFT* functionTable);
Parameters
- returnCode (output)
- Requires the return code from the function. Possible values are:
- CCI_DUP_USER_EXIT_NAME
The specified name matches the name of a user exit previously registered in the current integration server.
- CCI_INV_USER_EXIT_NAME
The specified name was invalid. This can be caused if a NULL pointer, empty string or a string containing non-alphanumeric characters was specified.
- CCI_DUP_USER_EXIT_NAME
- Name (input)
- This parameter must contain a pointer to a NULL-terminated string of CciChars
specifying a name for the user exit. The name must be unique across all user
exits that can be installed on the same integration node. This name is used to identify
the user exit in, for example:
- User Trace messages
- Exceptions or syslog messages
- Administration commands (for example, mqsichangeflowuserexits)
- It must consist of alphanumeric characters only.
- It must be no greater than 255 characters.
- The name must be unique across all user exits that can be installed on the same integration node.
- userContext (input)
- This parameter allows the caller to provide a context pointer that is passed to the callback function when it is called. This parameter can be NULL.
- functionTable (input)
- This parameter is a pointer to a struct whose fields must contain either
pointers to functions matching the correct signatures or contain NULL. A
NULL value for any of these fields indicates that the user exit must not be
called for that event.
Initialize the structure by using the define CCI_UE_VFT_DEFAULT, which sets the version as CCI_UE_VFT_CURRENT_VERSION. The cciOutputMessageCallback was added at version 2, CCI_UE_VFT_VERSION_2.
Return values
None. If an error occurs, the returnCode parameter indicates the reason for the error.
Example
extern "C"{
void bipInitializeUserExits(){
int rc = CCI_SUCCESS;
CCI_UE_VFT myVft = {CCI_UE_VFT_DEFAULT};
myVft.iFpInputMessageCallback = myInputMessageCallback;
myVft.iFpTransactionEventCallback = myTransactionEventCallback;
myVft.iFpPropagatedMessageCallback = myPropagatedMessageCallback;
myVft.iFpNodeCompletionCallback = myNodeCompletionCallback;
myVft.iFpOutputMessageCallback = myOutputMessageCallback;
cciRegisterUserExit(&rc,
MyConstants::myUserExitName,
0,
&myVft);
/*you should now check the rc for unexpected values*/
return;
}
}/*end of extern "C" */