Try our conversational search powered by Generative AI!

ICatalogSystem.SaveCatalogAssociation

Vote:
 

Product is complex object that encapsulates different data parts (metadata, prices, associations, relations...).

As I see from reflected code during update any of part IChangeNotificationManager.NotifyChanges is called. So subscribers can handle product change.

The only exception is associations update:

CatalogContextImpl.SaveCatalogAssociation doesn't make IChangeNotificationManager.NotifyChanges() call.

Consider this as a bug.

Declaring Type: Mediachase.Commerce.Catalog.Impl.CatalogContextImpl
Assembly: Mediachase.Commerce, Version=7.6.1.36
#87012
Jun 06, 2014 15:50
Vote:
 

Hi,

Actually, SaveCatalogAssociation raises (assocation) updating, updated and deleted events. If you want to listen to those event, you can implement a class for ICatalogEventListener and register it. I would say this is not a bug.

Regards.

/Q

#87074
Jun 09, 2014 15:40
Vote:
 

Yes, I saw this events, that is actually what I gonna do:) Thank you.

But, in general, we have two different approaches, two different "event message flows".  My point here is uniformity.

#87101
Jun 10, 2014 9:05
Vote:
 

ICatalogEventListener is also being used by other events, they should have same "event message flows". Actually Commerce is using the Framework Events to handle that, so it must be the same - I don't know why you observe the difference.

Regards.

/Q

#87105
Jun 10, 2014 9:23
Vote:
 

I'm taking about two different kind of "events"

1. Mediachase.Commerce.Catalog.EventContext (A)

2. EPiServer.Events.ChangeNotification.IChangeNotificationManager (B)

Second one IChangeNotificationManager.NotifyChanges is called if you change any "part" of product except associations. And I can't find reason for this.

For instance:

Mediachase.Commerce.Catalog.Impl.CatalogContextImpl.SaveCatalogEntry(CatalogEntryDto) does following:

- triggers A event:

        TransactionScope.OnCommit(delegate {
            CatalogCache.Clear();
            eventContext.RaiseEntryUpdatedEvent(dataset, new EntryEventArgs("updated"));
            foreach (DeletedEntryEventArgs args in deletes)
            {
                eventContext.RaiseEntryDeletedEvent(null, args);
            }
        });

- triggers B event

TransactionScope.OnCommit(() => this._changeManager.NotifyChanges<CatalogEntryChange>(changes));

That is ok.

My concern that Mediachase.Commerce.Catalog.Impl.CatalogContextImpl.SaveCatalogAssociation(CatalogAssociationDto) does trigger only A event.

And that should be unified with other CatalogContextImpl methods.

#87109
Jun 10, 2014 9:39
Vote:
 

Yeah, you're correct - _changeManager.NotifyChanges was missing when saving CatalogAssociationDto. This should be considered as a bug.

Thank you.

/Q

#87153
Jun 10, 2014 10:08
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.