cniFinalize

Causes the broker to request parsers that support the finalize feature to perform their finalize processing on the specified message. The behavior of this processing is specific to each parser.

If the options parameter is set to CCI_FINALIZE_VALIDATE, a parser should also perform validation processing to ensure that the element tree owned by it is of the correct structure. This helps prevent messages with incorrectly formed element trees being propagated to other nodes in the message flow.

It is recommended that cniFinalize is called before propagating a message (for example, before calling cniWriteBuffer).

Syntax

void cniFinalize(
  int*         returnCode,
  CciMessage*  message,
  int          options);

Parameters

returnCode
The return code from the function (output).
Possible return codes are:
  • CCI_SUCCESS
  • CCI_EXCEPTION
  • CCI_INV_MESSAGE_OBJECT
message
The address of the message object for which the element tree is to be finalized (input).
options
Specifies bit flags to identify the finalize or validate options to be used (input). This parameter is optional. You can set it to CCI_FINALIZE_VALIDATE.

Return values

None. If an error occurs, the returnCode parameter indicates the reason for the error.

Example

      cniFinalize(&rc, outMsg, CCI_FINALIZE_NONE);
      retvalue = cniPropagate(
                             &rc, 
                             terminalObject, 
                             destinationList, 
                             exceptionList, 
                             outMsg);

      /* Handle errors */