Purchase your Section 508 Compliance Support guide now!

Purchase your Section 508 Compliance Support guide now!

Cognos 8 SDK -- clearing the conversationContext

The first time a report is run the runOption for locale (RunOptionEnum.outputLocale) is set to "en-us". After the results have been obtained, the same report is run, but this time with the locale set to "fr-fr". The second report still uses the first locale ("en-us"). This also applies to other runOptions, for example RunOptionEnum.outputFormat.  This can be caused by the conversationContext from the first run being used for all subsequent run commands within the program. It has this session affinity to provide the query reuse functionality. 
 
You should clear the conversationContext prior to subsequent run commands.
 
Sample code:

  // Scrub the header to remove the conversation context.
  BiBusHeader bibus =
   (BiBusHeader) ((Stub)repService).getHeaderObject("", "biBusHeader");
  
  if (bibus != null)
  {
   if (bibus.getTracking() != null)
   {
    if (bibus.getTracking().getConversationContext() != null)
    {
     bibus.getTracking().setConversationContext(null);
    }
   }

  }