Sample - Validation Rule (VB.NET)

Version 2

    Versions: 9.3.1 - current

    Product Availability: ArcFM Desktop, ArcFM Engine

     

    This sample class validation rule ensures that the rated kVA of a transformer is equal to the total kVA of all the related transformer units.

     

    How to Implement:

    1. You may modify the code sample. This step is not required.
    2. Compile the code sample.


    How to Configure:

    1. This validation rule assumes a relationship exists between the Transformer and TransformerUnit object classes. Create this relationship in ArcCatalog if it doesn't already exist.
    2. This validation rule requires assignment of the TRANSFORMER and TRANSFORMERUNIT model names to their corresponding object classes. The RATEDKVA field model name must be assigned to the RatedkVA fields on the Transformer and TransformerUnit object classes.
    3. In ArcCatalog, this validation rule should be assigned to the Transformer feature class on the Object Info tab of the ArcFM Properties Manager.

    ValidationRuleVBNET.png    

     

    How to Use:

    1. In ArcMap, select one or more transformers to validate.
    2. Click the QA/QC tool on the ArcFM Solution toolbar or right click the feature (or feature layer) in the Attribute Editor and select Run QA/QC or Run QA/QC All.
    3. In the example below, we turned off the Update RatedKVA autoupdater on the relationship and added a Transformer Unit to the Transformer feature to force a scenario in which validation would fail.

    FailedValidationRule2.png  

     

    Requires:

    All of the files shown below are required for the solution to build successfully. The Miner.Samples.VBNet.ValidationRule.sln solution contains two projects. To re-compile, you must open the .sln file.

     

    FileDesciption
    Miner.Samples.VBNet.ValidationRule.vbprojVB .NET project containing code to generate a custom validation rule.
    RatedKvaValidationRule.vbDefines how the validation rule behaves.
    AssemblyInfo.vbSupporting class module
    Because the IMMExtObject interface is not available in Visual Basic .NET, the following C# class is provided to be used by VB .NET to inherit this interface.
    Miner.Samples.VBNetClasses.csprojThis project is located in this directory: Include Modules\VB.NET - Include Modules\VBNetBaseClasses\.
    BaseExtObject.csThis class makes the IMMExtObject interface available to Visual Basic .NET.
    AssemblyInfo.vbSupporting class module