cniGetThreadContext

This function returns the thread context for the current thread.

Syntax

CciThreadContext *cniGetThreadContext(
  int                    *returnCode,
  CciMessageContext      *msgContext);

Parameters

returnCode
This parameter is the return code from the function (output). If the input value is NULL, this value signifies that errors are silently handled, or are ignored by the integration node. If the input value is not NULL, the output signifies the success status of the call. If the msgContext parameter is not valid, *returnCode is set to CCI_INV_MESSAGE_CONTEXT, and a NULL CciThreadContext is returned.
msgContext
This parameter provides the message context from which to acquire the thread-specific context. It is expected that this parameter is obtained by using the cniGetMessageContext utility function.

Return values

If this function is successful, it returns a handle to the CciThreadContext for the current thread.

The cciMessageContext value must correspond to a cciMessage, where the cciMessage is passed in to the cniEvaluate or cniRun function on the current thread.

Example

CciMessageContext* messageContext = cniGetMessageContext(NULL,message);
CciThreadContext*  threadContext  = cniGetThreadContext(NULL,messageContext);