Meter Import Run

The Meter Import Run task imports water meter readings from one or more data files.

The import process uses a keyword-based template to match the data in the import file to the right tables and columns in the Infor Public Sector database. See the Infor Public Sector Correspondence Guide for details.

There are three different ways to import readings:

  • Export-Based Import: Imports one or more routes that were exported in a previous meter export run. This type of import is scheduled using the Lookup Cycle Reading Export/Import Schedule form in Infor Public Sector. When you schedule an export-based import, Infor Public Sector creates a reading import schedule, which specifies the import directory and the template to use, and adds a corresponding task in the Batch Manager.
  • Self Import: A self import is not connected to a previous meter export. The task imports reading data from a specified import data file. You can use the Self Import form to schedule a self import, or you can click the Self Import button in Lookup Cycle Reading Export/Import Schedule. As with an export-based import, Infor Public Sector adds an import schedule and a task in the Bach Manager.
  • Bulk Self Import: This type of import is scheduled in the Batch Manager directly. Each time it runs, the task will import each file in the specified import directory, using the specified template. Note that there won’t be a reading import schedule if you schedule the task in the Batch Manager, so the import process will first create a schedule for each file in the import directory.

Each type of import follows the same general process:

  1. Create database records to manage the import.

    The task creates a record in the READINGIMPORTACTIVITY table to keep track of the run, and then a READINGIMPORTROUTEDETAIL record for each route.

    For a bulk self import, as noted above, the task also creates a reading import schedule in the table for each file in the import directory.

  2. Read the data from the import files.

    The import processor reads the data and stores it temporarily for processing.

  3. Process the data.

    In this step the task sorts the imported readings by route and adds an import route record for each unique route in the import file. The task also loads the instructions codes that define how to handle certain codes in the import file, such as skip codes or new meters.

  4. Add to the database

    Finally, the reading data is added to the Infor Public Sector database.

Setup

This table describes the Configuration Editor settings that affect this task:

Configuration and path Comments
MeterManagement/ ImportTemplate Defines the available import templates.

This table describes the Infor Public Sector setup forms that are used to configure this task:

Setup form Comments
Cycle Reading Import Setup Sets various default options for the import process, such as the import directory path and the template to use.
Keyword Manager Defines the keywords that the import template uses to identify tables and columns in the database.

This table lists the database tables that store setup information for this task:

Table Comments
METERMANAGEMENT. READINGIMPORTSETUP Stores meter import setup data.

Identifying routes

There are two different ways you can identify meter routes in your import data files. This is important because Infor Public Sector sorts and processes imported readings according to the routes the meters belong to.

The first option is to group the readings by route in the import file and identify the route in each group’s header. A simplified example is shown below. In the import template, the route ID in each header row (identified by an H) is mapped to the keyword for the RouteID property (Hansen.MeterManagement.Water.Route.RouteId). Note that the example includes two different headers that identify the same route (Route1). The readings for a single route do not all need to be grouped together in the data file, as long as the route is identified in the header.

H|Route1
R|Meter11|Account11|01/11/2017|1200 
R|Meter12|Account12|01/11/2017|975 
H|Route2
R|Meter21|Account21|01/11/2017|850
R|Meter22|Account22|01/11/2017|1250
H|Route1
R|Meter13|Account13|01/11/2017|1150

The other option is to include the route ID within each reading, as shown in the example below. In this case the data file is a single list of meter readings. If you’re not using headers, you must map the route ID for each reading to the ReadVal4 property of the meter reading object (Hansen.AssetManagement.Water.MeterReading.ReadVal4).

R|Meter11|Route1|Account11|01/11/2017|1200
R|Meter12|Route1|Account12|01/11/2017|975
R|Meter21|Route2|Account21|01/11/2017|850
R|Meter22|Route2|Account22|01/11/2017|1250
R|Meter13|Route1|Account13|01/11/2017|1150

When processing readings, the import processor first checks for headers that specify route IDs. If no routes are found, the import processor looks for distinct ReadVal4 values within the meter readings. If the ReadVal4 values are valid route IDs, the readings will be sorted into the specified routes.

Invocation

To schedule meter import runs, you can use the Batch Manager, Self Import, or Lookup Cycle Reading Export/Import Schedules. To schedule a self import from the Self Import form, specify the import file name (click the Directory Search button to locate the file you want) and the schedule date and click the Schedule button.

The schedule an export-based import, first search for export schedules in Lookup Cycle Reading Export/Import Schedules, then select the schedule you want to import and click Import Exported Routes . You can then select the routes you want to import and create an import schedule.

This table describes each parameter for this task:

Form Console Description
Import Directory Path ImportDirectoryPath (string) Path to the directory where the data import files are kept. For a bulk self import, the task imports each file in this directory.
Import File Template ImportFileTemplate (string) Template to use for the import.
Reject meters when date read is earlier than the last reading date RejectPriorMeterRead (bool) Indicates that you want to exclude outdated readings in the import file (that is, the reading date is before the date of the most recent reading in the database).
Auto generate Service Request/Work Order during import ResolveServiceRequest (bool) Indicates whether you want Infor Public Sector to create any service requests or work orders for reader codes and problem codes in the import file.
ReadingImportScheduleKey (int) Can be used in the console application to start the import process for a specified schedule.

Monitoring

Several tables in the database are used to monitor the import process, especially READINGIMPORTACTIVITY, READINGIMPORTROUTEDETAIL, and READINGIMPORTMETERDETAIL. Each is described in more detail below, as well as in the introduction.

Common errors

This table lists some common errors that this task may return:

Error Message Comments
No such Route Exists in the System as defined in Import file for Importing its data. The task couldn’t find a route in the Infor Public Sector database that matches the route key or route ID of one of the routes in the import file.
No Route could be found in the Import file. The task couldn’t find any meter routes in the import file.
No Routes found in the system for this Import schedule to import. There are no routes associated with the reading import schedule, so there’s nothing to import.

Data output

This table lists the database tables in which this task adds or updates records:

Table Comments
ASSETMANAGEMENT_WATER. COMPWMTR For an export-based import, each imported meter’s OUTFORACTIVITYFLAG is set to N.
ASSETMANAGEMENT_WATER. METERPROBLEMCODE The task will add any problem codes in the import file that don’t already exist in the database.
ASSETMANAGEMENT_WATER. METERREADERCODE The task will add any meter reader codes in the import file that don’t already exist in the database.
ASSETMANAGEMENT_WATER. METERREADING Stores the imported meter readings.
ASSETMANAGEMENT_WATER. METERREADINGSOURCE The task will add any meter reading source codes in the import file that don’t already exist in the database.
ASSETMANAGEMENT_WATER. WATERLOCATION The task will add any water location codes in the import file that don’t already exist in the database.
CRM.CUSTPROB If any of the problem codes or reader codes in the import file specify request types for exception meters, Infor Public Sector will add service requests for those meters.
METERMANAGEMENT. READINGEXPORTROUTE For an export-based import, the EXPORTOUTSTANDFLAG for each imported route is set to N.
METERMANAGEMENT. READINGEXPORTROUTEDETAIL For an export-based import, the ISIMPORTED column for each imported route is set to Y.
METERMANAGEMENT. READINGIMPORTACTIVITY Each import run creates an import activity record, which is used to track the status and progress of the import. The current status is indicated by the STATUS column, using these codes: 0 (None), 1 (NotStarted), 2 (Processing), 3 (Processed), 4 (ProcessedWithExcpetion), 5 (Error), 6 (DoesNotQualify).
METERMANAGEMENT. READINGIMPORTMETERDETAIL Stores a record for each meter processed in the import run, indicating whether the meter is an exception and if so what type of exception.
METERMANAGEMENT. READINGIMPORTROUTE A reading import route record is added for each route associated with the import schedule.
METERMANAGEMENT. READINGIMPORTROUTEDETA IL Keeps track of each route within the import process. The STATUS column uses the same codes as in the READINGIMPORTACTIVITY table: 0 (None), 1 (NotStarted), 2 (Processing), 3 (Processed), 4 (ProcessedWithExcpetion), 5 (Error), 6 (DoesNotQualify).
METERMANAGEMENT. READINGIMPORTSCHEDULE If the schedule is rerun, the RERUNFLAG and RERUNNUMBER columns will be set.
METERMANAGEMENT. READINGIMPORTSETUP The IMPORTRUNNUMBER column is a counter that keeps track of the number of imports that have been run.
METERMANAGEMENT.ROUTE Updates the LASTDTTM and NEXTDTTM columns.
WORKMANAGEMENT.HISTORY If any of the problem codes or reader codes in the import file specify activities for exception meters, Infor Public Sector will add work orders for those meters.

This table lists the Infor Public Sector forms that you can use to review the results of this task:

Form Comments
Lookup Cycle Reading Export/Import Schedule Used to search for and review import schedules.
Cycle Reading Import Schedule InfoViewer Shows information on a selected schedule, and can also be used to rerun the import.
Water Meter InfoViewer Used to review readings for a selecting meter.