Previous Topic: Scenario B: Simple processing: Deferred completionNext Topic: Scenario B: ImportObject() Parameters


Scenario B: Processing steps

  1. CoCreate the COM object: CoCreate WgnActiveImportConnector and then obtain the IWgnImportConnectorConfig interface. As with scenario A, in this scenario there is no need to use the IWgnImportConnectorConfig interface.
  2. 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 (that is, any applicable smart tags) to the caller.

    As with scenario A, this scenario assumes that the caller does not intend to send the e‑mail to an archive. But unlike scenario A, in this scenario deferred completion is enabled.

    The parameters 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

TRUE

In scenario B, events processed by the policy engine cannot be committed to the CMS database until the caller has processed 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 B: ImportObject() Parameters.

  1. Is event savable? When the results of policy processing are returned to the caller, the next processing step depends on whether the event is savable. That is, did the event activate a policy trigger that would normally cause it to be saved on the CMS? If the event:
  2. IWgnSmartTag interface: If the call to ImportObject() is successful, the caller can call GetInterface() on the resultant IWgnImportConnectorResult interface to obtain the IWgnSmartTag interface.
  3. IWgnImportConnectorDeferredCompletion interface: If the call to ImportObject() is successful, the caller also calls the GetDeferredCompletion() method in the IWgnImportConnectorResult interface to return the IWgnImportConnectorDeferredCompletion interface.
  4. 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().
  5. Save the event? The caller assesses the smart tags returned by the External Agent.

    If the e-mail is in a 'must retain' category, the caller calls Commit() method in the IWgnImportConnectorDeferredCompletion interface to instruct the External Agent to save the e-mail to the CMS database.

  6. If the e-mail does not need to be retained, the caller calls Rollback() method to instruct the External Agent that the e-mail must not be saved in the CMS database.
  7. 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.