cniFinalize

Causes the broker to request parsers to perform finalize processing on the specified message. Finalization is a process that fixes header chains and makes the Properties folder match the headers.

The behavior of this processing is specific to each parser. Some parsers do not support finalization processing.

If you set the options parameter to CCI_FINALIZE_VALIDATE, the message parser performs validation processing to ensure that the element tree owned by it has the correct structure. Validation helps to prevent messages with incorrectly formed element trees being propagated to other nodes in the message flow.

Call cniFinalize before you propagate a message from the node; for example, before you call 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, 
                             localEnvironment, 
                             exceptionList, 
                             outMsg);

      /* Handle errors */