Customizing EmpowerID Event Receivers

EmpowerID provides a number of hard-coded methods, known as EmpowerID event receivers, that are called during inventory and attribute flow processes, providing organizations with the ability to write custom code that allows them to respond to specific actions carried out against objects discovered by EmpowerID. For example, one of the EmpowerID event receivers is the ActiveDirectoryAccountChangedReceiver event receiver. This event receiver is called as a "last resort" each time EmpowerID inventories Active Directory. It is the final method before EmpowerID calls InventoryBulkUpdate(), which pushes any changes in external Active Directory accounts to the EmpowerID Identity Warehouse. The default implementation of the ActiveDirectoryAccountChangedReceiver event receiver, as well as the default implementation for all EmpowerID event receivers, do nothing more than write out a record stating they have been called. However, each of these event receivers can can be custom coded to do anything from sending notifications of changes to interested parties, to initiating specific workflows to accomplish tasks related to those changes, to providing a fail-safe for corrective action when undesired changes are discovered.

Each EmpowerID event receiver lives as an object on the EmpowerIDEventReceivers table of the Identity Warehouse (for a tabular view of all the default EmpowerID event receivers, see the EmpowerIDEventReceivers table at the end of this topic), with two special properties, among others, the ReceiverAdapterAssembly property that refers to the specific assembly and the ReceiverAdapterType property that refers to the specific assembly with the code that is to be executed when the event receiver is invoked. When custom coding an existing default event receiver in this way, you simply create and publish a custom class library in Workflow Studio, being sure to implement to appropriate interface for the event receiver in the class. You then update the ReceiverAdapterAssembly and ReceiverAdapterType properties for the EmpowerID event receiver record in the EmpowerIDEventReceivers table. When event receivers are called, they look for the assembly and class to execute therein. If you do not update these properties, your custom code will not be called.

When customizing EmpowerID event receivers, you must be sure to implement the appropriate interfaces for those event receivers for your customization to work in EmpowerID. These interfaces are baked in and cannot be changed.


When EmpowerID executes the ActiveDirectoryAccountChangedReceiver event receiver, it does so in the following way. (The process is the same for each default EmpowerID event receiver.)

  1. In the following example, we create a class library in Workflow Studio implementing the IAccountChangedReceiver interface. This allows us to add code to the Receive() method to perform any actions when the ActiveDirectoryAccountChangedReceiver event receiver is invoked. We then compile and publish the class library and update the ReceiverAdapterAssembly and ReceiverAdapterType properties for the event receiver.

  2. EmpowerID calls the ActiveDirectoryAccountChangedReceiver.ExecuteReceiver() method, passing the collection of ExistingAccounts ;to the receiver. It does this right before the Account.InventoryBulkUpdate() method is called.

  3. ExecuteReceiver(), in turn, calls the EmpowerID database to get the values of the ReceiverAdapterAssembly and ReceiverAdapterType properties.
  4. ExecuteReceiver() then uses reflection to invoke the Receive() method implemented by the IAccountChangedReceiver interface. This method receives a collection of accounts.

  5. The Receive() method executes any code for the event receiver. Organizations wishing to implement their own custom code would do so here. We demonstrate this below.

    The below code below is for demonstration purposes only.

To customize the ActiveDirectoryChangedReceiver event receiver

  1. In Workflow Studio, click on the application icon to open the application menu and select Extensibility > EmpowerID Class Library.




  2. Name the Class Library "Custom_ActiveDirectoryAccountChangedReceiver" and save it to the package of your choice.




    Workflow Studio creates the class library and opens the C# Editor for it.




  3. In the C# Editor for the class library, add code to the class declaration to implement the IAccountChangedReceiver interface.

    public class Custom_ActiveDirectoryAccountChangedReceiver : TheDotNetFactory.Framework.ResourceManagement.IAccountChangedReceiver
  4. In the C# Editor for the class library, add the following code to the OnProcessAlert() method (Comments have been added for clarity).

    //Call the Receive() method of the IAccountChangedReceiver interface to return the collection of changed accounts
    public void Receive(TList<Account> changedObjects) 
    {
       //Create a list of account objects
       E.VList<C.AccounView> accList = new E.VList<C.AccountView>();
       //Add all changed objects to the list of account objects
       if(changedObjects.Count > 0) 
       {
    	foreach(var v in changedObjects)
              accList.Add(v); 
    				 
    	//Implement further code to work with the list as desired
            ...				 
    					 
       }
    }


  5. When ready, compile and publish the class library.
  6. In SQL Server, update the ReceiverAdapterAssembly and ReceiverAdapterType properties accordingly for the event receiver.

The following table contains the EmpowerID Event Receivers available to you.

IDNameDescriptionAdapter AssemblyAdapter Type
1ActiveDirectoryDeletedObjectsDiscoveredReceiverReceives all discovered deleted objects each time active directory inventory runs. Implements the IDeletedObjectsDiscoveredReceiver interface.TheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryDeletedObjectsDiscoveredReceiver
2ActiveDirectoryContainerDiscoveredReceiverReceives all discovered containers each time active directory inventory runs after the Locations are inserted in EmpowerID. Implements the IContainerDiscoveredReceiver interface.TheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryContainerDiscoveredReceiver
3Active Directory Container Changed ReceiverReceives all modified containers each time active directory inventory runs before the Locations are updated in EmpowerID. Implements the IContainerChangedReceiver interface.TheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryContainerChangedReceiver
4Active Directory Group Discovered ReceiverReceives all discovered groups each time active directory inventory runs after the Groups are inserted in EmpowerID. Implements the IGroupDiscoveredReceiver interface.TheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryGroupDiscoveredReceiver
5Active Directory Group Changed ReceiverReceives all modified groups each time active directory inventory runs before the Groups are updated in EmpowerID. Implements the IGroupChangedReceiver interface.TheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryGroupChangedReceiver
6ActiveDirectoryAccountDiscoveredReceiverReceives all discovered accounts each time active directory inventory runs after the Accounts are inserted in EmpowerID. Implements the IAccountDiscoveredReceiver interface.TheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryAccountDiscoveredReceiver
7ActiveDirectoryAccountChangedReceiverReceives all modified accounts each time active directory inventory runs before the Accounts are updated in EmpowerID. Implements the IAccountChangedReceiver interface.TheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryAccountChangedReceiver
8ActiveDirectoryExchangeMailboxDiscoveredReceiverReceives all discovered exchange mailboxes each time active directory inventory runs after the Exchange Mailboxes are inserted in EmpowerID. Implements the IExchangeDiscoveredReceiver interface.TheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryExchangeMailboxDiscoveredReceiver
9ActiveDirectoryExchangeMailboxChangedReceiverReceives all modified exchange mailboxes each time active directory inventory runs before the ExchangeMailboxes are updated in EmpowerID. Implements the IExchangeMailboxChangedReceiver interface.TheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryExchangeMailboxChangedReceiver
10ActiveDirectoryComputerDiscoveredReceiverReceives all discovered computers each time active directory inventory runs after the Computers are inserted in EmpowerID. Implements the IComputerDiscoveredReceiver interface.TheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryComputerDiscoveredReceiver
11ActiveDirectoryComputerChangedReceiverReceives all modified computers each time active directory inventory runs before the Computers are updated in EmpowerID. Implements the IComputerChangedReceiver interface.TheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryComputerChangedReceiver
12ActiveDirectoryExchangePublicFolderDiscoveredReceiverReceives all discovered exchange public folders each time active directory inventory runs after the Exchange Public Folders are inserted in EmpowerID. Implements the IExchangePublicFolderDiscoveredReceiver interface.TheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryExchangePublicFolderDiscoveredReceiver
13ActiveDirectoryExchangePublicFolderChangedReceiverReceives all modified exchange public folders each time active directory inventory runs before the ExchangePublicFolders are updated in EmpowerID. Implements the IExchangePublicFolderChangedReceiver interface.TheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryExchangePublicFolderChangedReceiver
14ActiveDirectoryLyncUserDiscoveredReceiverReceives all discovered lync users each time active directory inventory runs after the lync users are inserted in EmpowerID. Implements the ILyncUserDiscoveredReceiver interface.TheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryLyncUserDiscoveredReceiver
15ActiveDirectoryLyncUserChangedReceiverReceives all modified lync users each time active directory inventory runs before the LyncUsers are updated in EmpowerID. Implements the ILyncUserChangedReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ActiveDirectoryLyncUserChangedReceiver
16ADAMDeletedObjectsDiscoveredReceiverReceives all discovered deleted objects each time ADAM inventory runs. Implements the IDeletedObjectsDiscoveredReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ADAMDeletedObjectsDiscoveredReceiver
23ADAMContainerDiscoveredReceiverReceives all discovered containers each time adam inventory runs after the Locations are inserted in EmpowerID. Implements the IContainerDiscoveredReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ADAMContainerDiscoveredReceiver
24ADAMContainerChangedReceiverReceives all modified containers each time adam inventory runs before the Locations are updated in EmpowerID. Implements the IContainerChangedReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ADAMContainerChangedReceiver
25ADAMGroupDiscoveredReceiverReceives all discovered groups each time adam inventory runs after the Groups are inserted in EmpowerID. Implements the IGroupDiscoveredReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ADAMGroupDiscoveredReceiver
26ADAMGroupChangedReceiverReceives all modified groups each time adam inventory runs before the Groups are updated in EmpowerID. Implements the IGroupChangedReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ADAMGroupChangedReceiver
27ADAMAccountDiscoveredReceiverReceives all discovered accounts each time adam inventory runs after the Accounts are inserted in EmpowerID. Implements the IAccountDiscoveredReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ADAMAccountDiscoveredReceiver
28ADAMAccountChangedReceiverReceives all modified accounts each time adam inventory runs before the Accounts are updated in EmpowerID. Implements the IAccountChangedReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.ActiveDirectory.ADAMAccountChangedReceiver
29LdapDeletedObjectsDiscoveredReceiverReceives all discovered deleted objects each time Ldap inventory runs. Implements the IDeletedObjectsDiscoveredReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.Ldap.LdapDeletedObjectsDiscoveredReceiver
30LdapContainerDiscoveredReceiverReceives all discovered containers each time Ldap inventory runs after the Locations are inserted in EmpowerID. Implements the IContainerDiscoveredReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.Ldap.LdapContainerDiscoveredReceiver
31LdapContainerChangedReceiverReceives all modified containers each time Ldap inventory runs before the Locations are updated in EmpowerID. Implements the IContainerChangedReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.Ldap.LdapContainerChangedReceiver
32LdapGroupDiscoveredReceiverReceives all discovered groups each time Ldap inventory runs after the Groups are inserted in EmpowerID. Implements the IGroupDiscoveredReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.Ldap.LdapGroupDiscoveredReceiver
33LdapGroupChangedReceiverReceives all modified groups each time Ldap inventory runs before the Groups are updated in EmpowerID. Implements the IGroupChangedReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.Ldap.LdapGroupChangedReceiver
34LdapAccountDiscoveredReceiverReceives all discovered accounts each time Ldap inventory runs after the Accounts are inserted in EmpowerID. Implements the IAccountDiscoveredReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.Ldap.LdapAccountDiscoveredReceiver
35LdapAccountChangedReceiverReceives all modified accounts each time Ldap inventory runs before the Accounts are updated in EmpowerID. Implements the IAccountChangedReceiver interfaceTheDotNetFactory.Framework, 
PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.ResourceManagement.Managers.Ldap.LdapAccountChangedReceiver
36Management RAccountObjectAttributeInboxCreatedReceiverReceives all inbox attributes that are coming from a change in an external Account Store that should be synchronized to the EmpowerID Person before it gets added to the inbox to be processed. It returns all the attributes that need to be added. Implements the IAccountInboxReceiverCreatedReceiver interfaceTheDotNetFactory.Framework.People.Components,
Version=4.0.0.0, PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.People.InboxManagers.AccountObjectAttributeInboxCreatedReceiver
37AccountObjectAttributeOutboxCreatedReceiverReceives all inbox attributes that are coming from a change in the EmpowerID Person that should be synchronized to and external account before it gets added to the outbox to be processed. It returns all the attributes that need to be processed. Implements the IAccountOutboxReceiverCreatedReceiver interfaceTheDotNetFactory.Framework.People.Components,
Version=4.0.0.0, PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.People.InboxManagers.AccountObjectAttributeOutboxCreatedReceiver
38AccountInboxReceivedReceiverReceives all accounts that will be processed by the account inbox before being provisioned, joined or ignored. It returns all the accounts that need to be processed. Implements the IAccountInboxReceivedReceiver interfaceTheDotNetFactory.Framework.People.Components,
Version=4.0.0.0, PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.People.InboxManagers.AccountInboxReceivedReceiver
39AccountInboxJoinedReceiverReceives all accounts that have been joined by the account inbox. Implements the IAccountInboxJoinedReceiver interfaceTheDotNetFactory.Framework.People.Components,
Version=4.0.0.0, PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.People.InboxManagers.AccountInboxJoinedReceiver
41AccountInboxProvisionedReceiverReceives all accounts that have been provisioned by the account inbox. Implements the IAccountInboxProvisionedReceiver interfaceTheDotNetFactory.Framework.People.Components,
Version=4.0.0.0, PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.People.InboxManagers.AccountInboxAccountsToProvisionReceiver
42AccountInboxAccountsToProvisionReceiverReceives all accounts that will be provisioned as new people by the account inbox before being provisioned. It returns all the accounts that need to be processed. Implements the IAccountInboxAccountsToProvisionReceiver interfaceTheDotNetFactory.Framework.People.Components,
Version=4.0.0.0, PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.People.InboxManagers.AccountInboxAccountsToProvisionReceiver
43AccountInboxPeopleToProvisionReceiverReceives all empowerid person entries that will be provisioned as new people by the account inbox before being provisioned. It returns all the people that need to be processed. Implements the IAccountInboxPeopleToProvisionReceiver interfaceTheDotNetFactory.Framework.People.Components,
Version=4.0.0.0, PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.People.InboxManagers.AccountInboxPeopleToProvisionReceiver
44AccountInboxAccountsErrorReceiverReceives all accounts that had an error while being joined or processed and returns them. Implements the IAccountInboxAccountsErrorReceiver interfaceTheDotNetFactory.Framework.People.Components,
Version=4.0.0.0, PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.People.InboxManagers.AccountInboxAccountsErrorReceiver
45BusinessProcessCommentReceiverReceives all business process comments added to a business process when a comment is made; it does not return anything. Implements the IBusinessProcessCommentReceiver interfaceTheDotNetFactory.Framework.People.Components,
Version=4.0.0.0, PublicKeyToken=cdea72caaad57b56
TheDotNetFactory.Framework.People.Components.BusinessProcessCommentEventReceiver