ITQuants blog

Fusion Invest 6.x/7.x: how to migrate the deprecated CSREvent class?

Oct 29

Written by:
10/29/2014 11:47 PM  RssIcon

Working on a migration to the last version of Fusion Invest (7.1.x), and even if most Sophis developers warn me that this class will be deprecated in future versions of Sophis Risque/Value, I've discovered how deep changes were done on it.

Trying to migrate my performance tool ITQLogger in order to test the new grid cache server, I've got a lot of modifications to do and most cases are now obsolete..

For remember, for those who don't know this class, it was previously mostly used by developers in this case: 

 - changes are done on database, without using the API,

 -  other programs connected to this database have to be notified, to refresh the data.

For example, the last development I've made using a Sophis native 'AJTI' event was done when I had to insert directly in the TRS_BASKET and TRS_BASKET_ADJUSTMENT Oracle tables records, and notify other GUI clients that the instrument was modified. Such development was done due to the well-known poor performance on Sophis basket swaps, making it impossible to use the native CSRInstrument::Save method when a lot of adjustments are done (like on portfolio swaps).

The goal of this post will discuss which workarounds have to be done.

On Fusion Invest 7, toolkit changes were done as follow:

- CSRApi::HandleEvent disappears

- CSRGlobalFunctions::HandleEvent takes a reference as parameter and no more a pointer, and the class type is changed as follow: a new class CSRUserEvent is used instead of CSREvent.

- CSRGlobalFunctions::Send permits to send instances of the CSRUserEvent class instead of CSREvent class

- CSREvent class is deprecated, it is still defined, but unuseless, since no Send method exists on the new definition.

- it seems that the old CSREvent is replaced by a new class ISEvent, which is not exported neither in the official toolkit, nor in the Low Level toolkit.

Also, what about the Sophis native messages that we listened and sent before? Concerning the listening, nothing can be done again. Except for performance tool like ITQLogger, it has in fact no incidence. For developments which are using Sophis native event like 'AJTI' and so on, I would say that the workaround consists to notify the changes using a CSRUserEvent. For example, to send an instrument modification notification:

CSRUServer _event;
  
_event.SetEventID('ITQM');
_event.Add((long),_sicovam);
  
gGlobalFunctions->Send(_event);

 

And on the listening, overriding the CSRGlobalFunctions class by our ITQGlobalFunctions class, it should look like that:

void ITQGlobalFunctions::HandleEvent(const CSRUserEvent& event)
{
  long _eventID = event.GetEventID();
  if(_eventID=='ITQM')
  {
     long _sicovam = 0;
     if(event.GetAt(0,_sicovam)==0)
        CSRInstrument::Free(_sicovam);
  }
}

 

And I'm quite sure that same type of workaround can be done on other Sophis native events (transactions, volatilities,...).

Tags:
Categories: Sophis

1 comment(s) so far...


Gravatar

Re: Fusion Invest 7.x: how to migrate the deprecated CSREvent class?

Moreover, this post concerns any migration to the v6 too, since the change was already done on this previous version.

By Philippe Bonneau on   10/30/2014 10:22 AM

Search blog