cciRegisterUserExit

This is a utility function that can be called by the user’s code during invocation of bipInitializeUserExits. It is invoked 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;

} 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 execution group.

  • 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 alpha-numeric characters was specified.

Name (input)
This 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 broker. This name is used to identify the user exit in, for example:
  • User Trace messages
  • Exceptions or syslog messages
  • Administration commands (for example, mqsichangeflowuserexits)
The name has the following restrictions:
  • It must consist of alpha-numeric 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 broker.
userContext (input)
This allows the caller to provide a context pointer that is passed to the callback function when it is invoked. This parameter can be NULL.
functionTable (input)
This 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 invoked for that event.

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;
  
  cciRegisterUserExit(&rc,
                      MyConstants::myUserExitName,
                      0,
                      &myVft);

  /*you should now check the rc for unexpected values*/
  
  return;
}

}/*end of extern "C" */
Related concepts
Developing user exits
Related tasks
Developing a user exit