Previous Topic: Scenario A: Simple processing: Synchronous, with no deferred completionNext Topic: Scenario A: ImportObject() Parameters


Scenario A: Processing steps

  1. CoCreate the COM object: CoCreate WgnActiveImportConnector and then obtain the IWgnImportConnectorConfig interface.
  2. IWgnImportConnectorConfig interface: In this scenario, the External Agent passes e-mails directly to a policy engine. This is appropriate when calling WgnActiveImportConnector in synchronous mode. This is also the default configuration for WgnActiveImportConnector and so there is no need to use the IWgnImportConnectorConfig interface.
  3. IWgnActiveImportConnector interface: The calling application calls the ImportObject() method to synchronously pass an e-mail to the External Agent. This method internally passes the e-mail to a policy engine for processing and returns the results of that processing.

    The External Agent returns any associated smart tags to the caller. This scenario assumes that the caller requires these smart tags to categorize the e‑mail but does not intend to send the e‑mail to an archive. Deferred completion is not enabled.The parameter values needed to implement this scenario are therefore:

Parameters

Value

Notes

messageId

NULL

The caller does not archive e-mails after policy processing.

importSource

WGN_ACTIVEIMPORTSOURCE_NONE

 

 

The caller does not archive e-mails after policy processing.

xmlMessageAttributes

NULL

The caller does not pass additional event attribute data to the External Agent.

allowDeferredCompletion

FALSE

In scenario A, events processed by the policy engine can be committed to the CMS database without waiting for the caller to process the results of policy analysis.

Note:  For the full set of parameter values that must be passed to ImportObject() when processing a MAPI message, see Scenario A: ImportObject() Parameters.

  1. IWgnSmartTag interface: If the call to ImportObject() is successful, the caller can call GetInterface() on the resultant IWgnImportConnectorResult interface to obtain the IWgnSmartTag interface.
  2. Process the smart tags: Any smart tags assigned to the e-mail by the policy engine can be processed by calling the GetSmartTagXML() method, which retrieves the message smart tags encoded in XML, or enumerated by calling methods such as GetCount() and GetSmartTag().
  3. Release the interfaces: After each message has been processed, the caller must release the 'message processing' interfaces. In this scenario, these are the IWgnImportConnectorResult and IWgnSmartTag interfaces.

    The WgnActiveImportConnector boundary interfaces must be released at the end of the session. These are the IWgnImportConectorConfig (if queried) and IWgnActiveImportConnector interfaces.

More information:

Synchronous Versus Asynchronous Operations

Single-pass Processing Versus Deferred Completion