Sample - Submit Rule

Version 6

    Versions: 10.1 - current

    Product Availability: Responder

     

    This project sample illustrates how to manipulate (insert, update, delete) data from a submit rule to modify rows in the DataSet.


    How to Implement:

    1. Open SubmitRule.csproj and connect any broken references.
    2. Modify the submit rules you wish to implement.
    3. Build the solution.
    4. Open the SubmitRulesConfig.xml file typically stored here: C:\Program Files (x86)\Miner and Miner\Responder\Server.
    5. Add the following RuleClasses to the PreProcessRules section of the config file:

       <b:RuleClass Key="" Type="SubmitRule.CreateSOOnConfirmed, SubmitRule" />

       <b:RuleClass Key="" Type="SubmitRule.PreventTimeChangeOnUnconfirmed, SubmitRule" />

       <b:RuleClass Key="" Type="SubmitRule.PopulateAddressOnOperationRemarks, SubmitRule" />

       <b:RuleClass Key="" Type="SubmitRule.PopulateRegionOnCall, SubmitRule" />

       <b:RuleClass Key="" Type="SubmitRule.DeleteHistoryOnCancel, SubmitRule" />

       <b:RuleClass Key="" Type="SubmitRule.SetTimeRestoredEstOnIncidentCreate, SubmitRule" />


    1. The beginning of the PreProcessRules section should resemble the following:

    <RulePackage Key="PreProcessRules" Caption="">

       <b:RuleClasses Key="">

       <b:RuleClass Key="" Type="SubmitRule.CreateSOOnConfirmed, SubmitRule" />

       <b:RuleClass Key="" Type="SubmitRule.PreventTimeChangeOnUnconfirmed, SubmitRule" />

       <b:RuleClass Key="" Type="SubmitRule.PopulateAddressOnOperationRemarks, SubmitRule" />

       <b:RuleClass Key="" Type="SubmitRule.PopulateRegionOnCall, SubmitRule" />

       <b:RuleClass Key="" Type="SubmitRule.DeleteHistoryOnCancel, SubmitRule" />

       <b:RuleClass Key="" Type="SubmitRule.SetTimeRestoredEstOnIncidentCreate, SubmitRule" />

       <b:RuleClass Key="" Type="Miner.Responder.Processors.SubmitRules.Pre.AmiRxRestoredNotification, Miner.Responder.Processors" />

     

    1. Add the following RuleClass to the END of the PreProcessRules section of the config file:

    <b:RuleClass Key="" Type="SubmitRule.NotifyOfDeviceChange, SubmitRule" />

     

    1. The end of the PreProcessRules section should resemble the following:

    <RulePackage Key="PreProcessRules" Caption="">

       <b:RuleClass Key="" Type="Miner.Responder.Processors.SubmitRules.Pre.UpdateJumperJunctions, Miner.Responder.Processors" />

       <b:RuleClass Key="" Type="Miner.Responder.Processors.SubmitRules.Pre.PopulateJumperDescription, Miner.Responder.Processors" />

       <b:RuleClass Key="" Type="SubmitRule.NotifyOfDeviceChange, SubmitRule" />

     

    1. Save the config file and restart services and Responder to see changes.


    Requires:

    All of the files shown below are required for the project to compile successfully.

     

    FileDescription
    SubmitRule.csprojC# project containing the code to create a Submit Rule
    CreateSOOnConfirmed.csClass module that automatically creates a switching order for one open confirmed device during an outage incident.
    DeleteHistoryOnCancel.csThis submit rule is relevant only if you have the Responder configuration for DeleteHistory set to false. When DeleteHistory is set to false, the history for every incident is retained at all times. This submit rule will ensure history is deleted when an incident is cancelled. Available at versions 10.2.1a - current
    PopulateAddressOnOperationRemarks.csClass module that displays the address of a feature in the Operations Summary field if the feature has the RX_ADDRESS model name assigned and populated.
    Available at versions 10.1.1 - current
    PopulateRegionOnCall.cs

    Class module that attempts to populate the region based on the customer or the device from a call.

    Available at versions 10.1.1 - current

    PostCommitRule.cs

    Class module that notifies an external system when the transaction has been committed

    Available at versions 10.1.1 - current

    PreventTimeChangeOnUnconfirmed.csClass module that prevents changing time of operation on unconfirmed devices.
    SetTimeRestoredEstOnIncidentCreate.cs

    This submit rule allows you to set the Time Restored Est field by default when editing an incident. This sample provides a number of ways to do this.

    1. Set the Time Restored Est field using a default amount of time (e.g., 2hrs).
    2. Set the Time Restored Est field using a variety of criteria. This sample submit rule allows you to set the Time Restored Est field's default value based on any of the following criteria (e.g., set phase A devices to 2hrs and phase BC devices to 4hrs).
      • XY coordinates
      • Feature ID
      • Facility ID
      • Feeder ID
      • Phases
      • Region
      • Subtype
      • Operating Voltage
      • Feature class name
    3. Leverage historical Responder data to determine the Time Restored Est value. This sample submit rule accesses historical Responder data in your database and analyzes it to determine the average outage time. Using the criteria listed above, you can set the Time Restored Est field based on the average outage time. For example, this sample can determine the historical average outage duration by region, then set the Time Restored Est field accordingly.

    Available on versions 10.2.1a - current

    AssemblyInfo.csClass module to support the project
    SubmitRulesConfig.xmlXML configuration file that specifies which submit rules to run