Solution - Designer - Standalone Orphaned Versions Cleanup Tool not Deleting Design Versions

Version 5



    Designer does not properly delete orphaned designs versions when a custom standalone Orphan Version Cleanup tool (OVCT) is used and run outside of ArcCatalog.




    The Process Framework Workspace is not set when run outside of ArcCatalog. The custom standalone application must set the workspace as it is required by the Design deleter. A custom extension can be created to do this.




    The first snippet below is the code which must be added to the standalone Orphan Version Cleanup tool project sampled found here: Sample - Automated Cleanup

    The below code loads a custom extension (second snippet and attached to this post) properly setting the workspace. This should allow Designs to be deleted when run outside ArcCatalog.


    //Create our dummy login connection extension so that the OOTB design deleter
    //works as expected.  This gives the product code an extension with the
    //"MMPropertiesExt" name to grab a workspace from in a specific area of the
    //design deleter OOTB code.
    IExtensionManager pExtMan = Activator.CreateInstance(Type.GetTypeFromProgID("esriSystem.ExtensionManager")) as IExtensionManager;
    IExtensionManagerAdmin pExtManAdmin = pExtMan as IExtensionManagerAdmin;
    UID OVCLoginExtUID= new UID();
    OVCLoginExtUID.Value = "{49b246c0-2d1a-4c98-9a72-bb2681e4bce9}";
    object obj = workspace as object;
    pExtManAdmin.AddExtension(OVCLoginExtUID, ref obj);
    // You will want to add the above code after the following lines from the sample which retrieve the geodatabase:
    IWorkspace workspace = GetWorkspace();
    if (workspace == null)
        ProcessMessage("Could not connect to the Geodatabase! Exiting application.");


    The custom extension is attached and must be either included with the custom OVCT project or as a separate register-able assembly. If the ladder approach is taken, the extension must be properly registered with regx (ArcFM Desktop Developer Guide)