In Kentico 8.2 I'm trying to write an integration connector subscribed to the creation of activities.
I've create the connector (code below), registered it in Kentico and enabled integration bus in Settings. When I debug the application I see the Init method in my connector being hit so I know it's registered correctly. However, navigating the site I can see activities being created in the database, but my ProcessInternalTaskAsync method is never being hit. Anyone know why this might be?
UPDATE: If I amend this to subscribe to user object changes then it works. Does this mean it is not possible to subscribe to activity events? If this is true, how best to trigger 3rd party integrations based on user actions?
public class CrmIntegrationConnector : BaseIntegrationConnector
{
public override void Init()
{
this.ConnectorName = GetType().Name;
SubscribeToObjects(TaskProcessTypeEnum.AsyncSnapshot, PredefinedObjectType.ACTIVITY, TaskTypeEnum.CreateObject);
}
public override IntegrationProcessResultEnum ProcessInternalTaskAsync(GeneralizedInfo infoObj, TranslationHelper translations, TaskTypeEnum taskType, TaskDataTypeEnum dataType, string siteName, out string errorMessage)
{
try
{
if (infoObj.TypeInfo.ObjectType == PredefinedObjectType.ACTIVITY)
{
var activity = ((BaseInfo)infoObj) as CMS.OnlineMarketing.ActivityInfo;
}
//Set the error message to null and the response to OK
errorMessage = null;
return IntegrationProcessResultEnum.OK;
}
catch (Exception ex)
{
//There was a problem.
errorMessage = ex.Message;
return IntegrationProcessResultEnum.ErrorAndSkip;
}
}
}
Any ideas why this might be?