Sample - Geodatabase Manager: Action Handlers

Version 4

    Versions: 9.3.1 - current

    Product Availability: Geodatabase Manager (ArcFM Desktop, ArcFM Engine)


    Geodatabase Manager uses action handlers to perform specific tasks on certain events. Action handlers are provided with Geodatabase Manager, but you may also create custom action handlers. This developer sample offers two sample action handlers.

    • Log To Reconcile History: This action handler writes information about the reconcile process to a log file. Available in Geodatabase Manager on the following actions: Before Reconcile (all node types), After Reconcile (all node types).
    • Delete by Work Function: This action handler deletes objects by work function. Available in Geodatabase Manager on the following actions: Before Post (Design)

    How to Implement:

    1. You may modify the code sample. Each custom action handler class must inherit from ActionHandler or PxActionHandler. Override the Enabled and SubExecute (or PxSubExecute) methods. This step is not required.
    2. Open the solution and select Project > Miner.Samples.ActionHandlers Properties.
    3. On the Signing tab, create a strong name key file to sign the assembly. Uncheck the box to delay the signing.
    4. Build the solution.
    5. Copy Miner.Samples.ActionHandlers.dll into Program Files (x86)\Miner and Miner\ArcFM Solution\bin.
    6. Open a Visual Studio 2010 Command Prompt.
    7. Build the assembly with a strong name and make note of the resulting public key token. You will need this for the configuration file. The screenshot below shows how to use sn.exe to assign a strong name and get the public key token for configuration.



    1. Next, you'll add your custom action handler to the Geodatabase Manager configuration file. Open GeodatabaseManagerAdmin.exe.config. By default, this file is installed here: C:\Program Files (x86)\Miner and Miner\ArcFM Solution\Bin.
    2. Look for the following XML:

            <ActionHandlerAssembly type="Miner.Geodatabase.Engine, Version=, Culture=neutral, PublicKeyToken=196beceb052ed5dc"/>
            <ActionHandlerAssembly type="Miner.Process, Version=, Culture=neutral, PublicKeyToken=196beceb052ed5dc"/>

    1. Add an <ActionHandlerAssembly> tag for your custom project. Update the type attribute with your assembly name and the PublicKeyToken value. For example:

          <ActionHandlerAssembly type="Miner.Samples.ActionHandlers, Version=, Culture=neutral, PublicKeyToken=04352abd332ef1ac"/> 

    1. Save and close GeodatabaseManagerAdmin.exe.config.

    How to Use:

    1. Open Geodatabase Manager.
    2. Select the Version Processing tab and add an action handler to one of the events on which the sample action handlers are available (e.g., Before     Reconcile, Before Post on a design).
    3. Select the action handler in the tree at the left and choose your sample action handler from the Action Handler field at the right.




    All of the files shown below are required for the solution to build successfully.


    Miner.Samples.ActionHandlers.csprojC# project containing the code to create custom action handlers for use in Geodatabase Manager.
    LogToReconcileHistory.csClass for a sample action handler that writes information about the reconcile process.