public virtual void Handle(MigratingInstanceParseContext parseContext, MigratingActivityInstance owningInstance, IList <EventSubscriptionEntity> elements) { var targetDeclarations = GetDeclarationsByTriggeringActivity(owningInstance.TargetScope); foreach (var eventSubscription in elements) { if (!SupportedEventTypes.Contains(eventSubscription.EventType)) { continue; } var migrationInstruction = parseContext.FindSingleMigrationInstruction(eventSubscription.ActivityId); var targetActivity = parseContext.GetTargetActivity(migrationInstruction); if ((targetActivity != null) && owningInstance.MigratesTo((ScopeImpl)targetActivity.EventScope)) { // the event subscription is migrated //EventSubscriptionDeclaration targetDeclaration = targetDeclarations.Remove(targetActivity.Id); //owningInstance.addMigratingDependentInstance(new MigratingEventSubscriptionInstance(eventSubscription, targetActivity, migrationInstruction.UpdateEventTrigger, targetDeclaration)); } else { // the event subscription will be removed owningInstance.AddRemovingDependentInstance(new MigratingEventSubscriptionInstance(eventSubscription)); } //parseContext.consume(eventSubscription); } if (owningInstance.Migrates()) { AddEmergingEventSubscriptions(owningInstance, targetDeclarations.Values); } }