Interface Import

 

The details outlined in this document represent the requirements to import data from another system to MTech. This document summarizes the base concept for all exports, however each export will be uniquely defined based on the requirements. The assigned Project Manager can provide sample interface requirements for many types of  export interfaces.

 

 

The following procedures and options are covered in this document:

Create an Interface

The following sections are defined in the Create Interface section of this document:

Definition

  1. In Admin>System>Interfaces, select Interfaces.
  2. Select to create a new interface.

 

  1. Enter the Interface Name for interface. Alphanumeric, 50 characters maximum.
  2. Select the Interface Type as `Import`.
  3. Select the Interface Class ID as required for the import.
  4. Interface Description is an optional location to enter a description for the import to identify the data that is being imported as well as any other details related to the import.
  5. The Schedule flag will be selected if there is a schedule associated with the interface. If the flag is not selected, then there is no schedule assigned and the interface must be run manually.
  6. Web Service is currently not an available option.
  7. Last Run Status displays the status after the interface was last executed. If 'NA' appears as the status, the interface has never been run. Otherwise, the field will display 'Success' or 'Failed'.
  8. Last Run Date indicates the date that the interface was last executed. The default date of 11/30/1899 will be displayed until the interface is run for the first time.
  9. Creation User ID displays the user that created the interface.
  10. The Prompts section is intended to be used for Web Service which is currently not an option.
  11. Click the in the menu bar to complete the remaining requirements for the import interface.

 

General Import Configuration

  1. Selecting the Wizard option will open the General Import Configuration.


  1. Import Name and Import Type  will be derived from the initial screen.
  2. Select the Data Source. The current options available are Database, File, FTP, HTTP and OData.
  3. Select the required Import Update Option. Options available will be:
    1. Create New Always - all source records will be treated as new records
    2. Log Duplicate Records - duplicate records will be logged as errors
    3. Update Existing Records - existing records will be updated with the source data
  4. Select the required Import Error Enforcement that controls how the errors affect the completion of the import. Options available are:
    1. Allow Non-Critical Errors - errors that are considered non-critical will allow the import to execute and provide warnings.
    2. None - there is no enforcement on errors.
    3. Strict - all errors will stop the import of data
  5. The Import Record Creation Policy determines how the import engine handles the creation of records. Options available are:
    1. Always Create Non-Modified Records - always creates records even if all of the default values were not modified.
    2. None - does not create any records.
    3. Remove Non-Modified Records - removes record from import if all of the default values were not modified.
  6. Enter the number of lines that will be viewed in the export preview in the Import Preview Amount. This data will be viewed to validate that the source data appears correct.
  7. Select the required option for Last Run Status Option. This option determines what the status will be if no records are exported. The options available are NA or Failed.
  8. Click Next to move to the Source Configuration screen.

 

Source Configuration

Depending on the Data Source, the Source Configuration screen will vary based on the requirements. Click on the required Data Source type to view the required configuration.

Database
  1. In the Destination Connection, select the ellipse to open the Connection Builder.

 

    1. Select the Database type. Options will be Microsoft SQL Server, Microsoft Access or Oracle Database.
    2. Select the required Server.
    3. Select the Authentication. Options will be Windows Authentication or SQL Server Authentication.
    4. If required, enter the Login and Password.
    5. Select the required Database.
    6. Click OK
  1. Define the query required for the source data.
  2. Click Next to close the query builder.
  3. Select the Database Date Format for the source data.
  4. Select Preview Data to view the source data.
  5. Click Next to move to the Source Field Properties.
File
  1. In the Source Configuration screen, select the Import File Format. Options will be Delimited File or XML Files.
  2. Select the File Mode. This option is only required for File and FTP data sources. Options are as follows:
    1. Multiple Files - imports from all files matching the given file pattern.
    2. None - does not import from any files.
    3. Single - imports from a single file source.
  3. Select the Data Server is the data source is set to Database. Other data sources do not require the field to be selected.
  4. Select the File Name for the import.
  5. In the File Date Format, select the date format for the source import data.
  6. Click on the ellipse in the Intermediate SQL field if additional SQL statements must be run against the data being imported to change or modify fields.
  7. Depending on the selected Import File Format, there will be a tab with fields to enter the required details.
  8.  

      Delimited File:

    1. Select the File Delimiter. Options available are Comma, Custom, Pipe, Semicolon or Tab.

    2. If Custom is selected as the File Delimiter, enter the character in the Other File Delimiter.

    3. Select First Row Has Column Headers if the first row of the file is defined as headers.

    4. Select Include File Line if the source file line is to be added to the intermediate table.

    5. Click Preview Data to view the source data.

    6.  

      XML File:

    1. Enter the XML statement in the XML Configuration File.

  9. Click on Next to move to Source Field Properties.

FTP

Prior to using FTP as the required Destination Type, the FTP server must be set up in Admin>System>Servers.

 

 

  1. Select the Import File Format. Options will be Delimited File or XML.
  2. Select the File Mode. Options will be Single File, None or
  3. Select the FTP Server that will receive the data.
  4. Select the Directory Path Name for the data to be exported.
  5. Select the File Name that will receive the export data.
  6. The File Extension will default from the selected file.
  7. Enter the Date Format to Append the current date and time to the file. An example would be: YYYY-MM-DD_hh_mm_ss.
  8. Full Path Preview provides the user with the complete destination location for the export data.
  9. Export to File Format indicates the type of file that will receive the export data. Options are CSV, Fixed Field, Pipe, Tab or xml.
  10. Select Output Column Headers if the data headers are to be exported to the export file. Do not select the option if the headers are not required.
  11. Select Do Not Create File If No Records if the file is not to be created where no data exists. Leave field blank if the file is always to be created.
  12. Select Next to move to E-Mail Configuration or Finish to complete the interface definition if e-mail is not required.
HTTP

  1. Enter the HTTP Connection String in the text field associated with the import.
  2. Enter the HTTP Address for the import data.
  3. In the SQL Select Statement, select the text box and define the SQL statement to extract the data for the import.
  4. Select the required Database Date Format from the drop-down box.
  5. Select Next to move to E-Mail Configuration or Finish to complete the interface definition if e-mail is not required.
OData

  1. In the Service Root Address field, enter the web address for the source data.
  2. Request Uri defines the request that OData uses to query the resources.
  3. In the OData Date Format, select the required date format of the data that is being imported.
  4. Select the Use System Date Filter if it is required to define a date filter based on the current system date.
  5. Start Date Offset (Days) defines the number of days to offset the system date to filter the data for the import. This value can be positive or negative.
  6. Filter Window represents the number of days to add to the Start Date as computed by the Start Date Offset.
  7. In the Source Field, select the field that represents the data filter.
  8. In the Intermediate SQL, enter the SQL statement to update the source data with any required options.

  9. Select Next to move to E-Mail Configuration or Finish to complete the interface definition if e-mail is not required.

 

Source Field Properties

Source Field Properties sets the default properties from the source file. The user has the option to modify the defaults as required.

 

 

  1. Source Field displays the name of the field in the source file.
  2. Assumed Data Type is the derived field type based on the source file.
  3. Override Data Type allows the user to modify the Assumed Data Type. Click on the drop-down to select the required data type.
  4. Field Size is based on the Assumed Data Type. If the data type is overridden, the Field Size may require modification.
  5. Check any fields that are required to be displayed in the error logs.
  6. Click Next to move to Field Mapping.

 

Field Mapping

Field Mapping maps the source file to the destination tables.

 

  1. Select the Table Name for the mapping. Several tables may be displayed for the fields to be mapped correctly.
  2. The Required flag will default as selected for any fields that must be mapped. If the Required flag is not selected, the field mapping is optional.
  3. Data Type represents the data type of the destination field in MTech.
  4. Destination Field is the name of the field in MTech.
  5. In the Source Field, select the corresponding field for the Destination Field. If the field requires additional specifications, the Derived Field can be used. This may be used to define a specific value for a field or define an enum that may exist in the system for certain fields.
  6. Click on the Derived Field if required to define the parameters.

 

Constant SQL Lookup

 

    1. The Derived Field Name will automatically be set to the Destination Field prefixed by 'my' so that it is identified as a derived field.
    2. Select the Derived Method. Options will be:
      1. Constant - sets a constant value to a field
      2. None - no derived value.
      3. SQL Lookup - uses a SQL statement to create the derived field.

 


  1. At least one field must be set as Unique Field. Multiple fields may be required to identify the records.
  2. Select the Display in Log for the fields that are required to be displayed in the error logs.
  3. Click Next to move to Intermediate Results Preview.

 

Intermediate Results Preview

  1. In the Filter Criteria, select the option to view All data or Only Rows with errors.
  2. Click Preview Intermediate Results to review the source data.
  3. Click Next to move to Results Preview.

 

Results Preview


  1. In the Filter Criteria, select the option to view All data or Only Rows with errors.
  2. Click Results Preview to review the data in the destination view.
  3. Click Next to move to Post Import Configuration.

 

Post Import Configuration

There are three sections to configure related to Post Import.

General


  1. Post Process SQL is used to update the SQL after the records are imported. Click on the ellipse to define the SQL statement. This option will not execute from the wizard.
  2. Select Use Source Connection String for the Post Process SQL. If the option is not selected, the process will use the current connection string. This option must be left unchecked if the Data Source is set to File.
  3. Select Use Transaction Scope for Post Process if required. Leave unchecked if it is not required.

 

Error File


  1. If error files are to be archived, select Archive Files with Errors and the files will be moved to the user defined location. If the error files are not to be archived, do not select the option and the error logs will be saved in the source location.
  2. If the Archive Files with Errors option is selected, specify the path to save the error logs in Error File Path.
  3. In the Error Date Format to Append, enter the format of the date that is to be added to the error log file name. An example would be '_yyyymmdd_hhmm_ss'.
  4. In the Error File Movement Option, select the action to perform for the error log after the import has been run. The options will be Append to Existing File or Overwrite Existing File.
  5. Error Path Preview displays the location where the error file will be saved and how the file name will be displayed.
  6. The Only Output Lines with Errors option is only available when Delimited File is the selected source file type.

 

Completion File


  1. Select the Completed File Path to move the source file after it is completed.
  2. In the Completed Date Format to Append, enter the format of the date that is to be added to the source file after it has been imported. An example would be '_yyyymmdd_hhmm_ss'.
  3. Select the Completed File Movement Option to determine the action on the source file after it has been imported. Options are Append to Existing File, Do Nothing, Overwrite Existing File.
  4. Completed Path Preview displays the location where the source data file will be saved and how the file name will be displayed.
  5. Click Next to move to E-Mail Configuration.

 

E-Mail Configuration

  1. Select the Send E-Mail option if there is to be an e-mail sent when errors occur in the process.
  2. In the To: field, enter the e-mail addresses that are to receive the e-mail separated by a semi-colon.
  3. In the Cc: field, enter the e-mail addresses that are to copied on the e-mail separated by a semi-colon.
  4. The Subject must be defined if the Send Email option is selected. If this is not acceptable, enter the text that is to appear in the e-mail subject line.
  5. Click Next or Finish to complete the wizard process.

 

Execute an Interface

The Execute Interface option runs the interface definition and imports the data to MTech. Options for generating the interface are as follows:

 

  1. From Admin>System>Interfaces, select the interface and right-click to select Execute Interface.
  2. From Admin>System>Interfaces, select the interface and select Options>Execute Interface from the tool bar.
  3. From Admin>System>Interfaces, edit the interface and select Options>Execute Interface from the tool bar.

Interface Error Logs

The Interface Error Logs provide details related to number of records imported and specifies any errors that may be incurred during the import process. There are two access the logs. The 'View Logs' option displays all logs that have been generated from the interface. The 'View Last Log' only displays the last generated log. Options for viewing the interface logs are as follows:

 

  1. From Admin>System>Interfaces, select the interface and right-click to select View Logs or View Last Log.
  2. From Admin>System>Interfaces, select the interface and select Options>View Logs or Options>View Last Log  from the tool bar.
  3. From Admin>System>Interfaces, edit the interface and select Options>View Logs or Options>View Last Log  from the tool bar.

 

This will display the Import Error Log.

 

Import Log
  1. Interface displays the name of the interface that has generated the error log.
  2. Run Date Time indicates when the interface was executed.
  3. The Status will display how many records were imported based on the total records.
  4. The Data Source represents the name of the source file that contained the data.
  5. Error Message will display any error messages that relate to the overall interface configuration.
Import Log Errors

This section displays errors related to the actual data that is being imported.

  1. Record Display Name indicates the table record that the data is being imported.
  2. Invalid Property Name will provide the details for any errors that are generated from the interface.
  3. Error Detail provides a description related to the error so that the user can determine how to resolve.

 

Scheduling Interfaces

There is an option to schedule interfaces for those that are required on a regular basis. Before the scheduler can be used, the Job Service Scheduler must be installed. The following topics are covered in this section:

Install Job Scheduler Service

  1. The user will be provided with a file for the installer named MTechSystems.JobScheduler.Setup. msi.
  2.  Double-click to start the installation process and install in a folder dedicated to the installer. The job scheduler will install as a Windows service called MT Job Schedule Service.
  3. Configure the Job Scheduler Service with a user that has permissions to read and write from the import and export folders. This can be accomplished by selecting the Log On tab in Service Properties and use This Account option to define the user. A domain service account may also be created for this purpose.
  4.  

     

  5. Edit the MTechSystems.JobScheduler.Service.exe.config file in the installation folder of the MT Job Scheduling Service (completed in Step 1). Edit the datasource.default.connectionstring value to match the values found in the mtech.cnn file.
  6.  

  7. Edit the Proteinexe.exe.config to reflect the server:port specified from the MTechSystems.JobScheduler.Service.exe.config.
  8.  

     

  9. Ensure that the Protein folder and subfolders have read/write/modify permissions for all users that intend to use the program.

Configure Scheduler

This section will demonstrate how to assign a schedule to the interface.

 

  1. To schedule a job, select the required job from the index and right-click to select Schedule Job.
  2. This will launch the Job Scheduler Wizard for the selected interface.
  3. If no triggers exist, select the Create Trigger tab. In the Trigger field, enter a name for the schedule trigger, such as Daily, Weekly, Hourly and select Create Trigger.
  4. If Triggers exist, click the Select Trigger tab and select the required trigger for the interface.
  5. Click Next to move to the configuration of the General details.

 

  1. Trigger Name will default from the selected trigger as read-only.
  2. Job Name will display the system code for the interface that is being scheduled.
  3. Job Group will display the type of interface. The field will display Import Group or Export Group depending on the type of the interface.
  4. In the Trigger Description, enter a description for the schedule.
  5. Select one of the following options for Trigger Type.
    1. Cron Trigger - used to schedule jobs that recur based on calendar-like notions.
    2. Simple Trigger - used to schedule jobs that occur at a specific moment and recurring in regular intervals.
  6. Enabled will default to selected to indicate that the schedule will be executed. Un-check the option if the schedule is no longer required to be run.
  7. Select the Trigger Priority. Options will be High, Medium or Low.
  8. Select Next to move to Conditions. The Conditions screen will be different for Cron Trigger or Simple Trigger.

 

Cron Trigger

  1. Select the option for the schedule as Daily, Weekly or Monthly. Depending on the selected option, the configuration screen will appear with different options.

Daily

  1. In the Start Field, enter the start date and time for the schedule.

  2. In the Recur Every (Days), enter the number of days before the next schedule runs.

 

 

Weekly

    1. In the Start field, enter the start date and time for the schedule.
    2. Enter the recurrence in the Recur Every (weeks) field.
    3. In the On the Days field, select the days that the day(s) of the week that the schedule is to run.

 

 

Monthly

  1. In the Start field, enter the start date and time for the schedule.

  2. Select the Months that the schedule is to run.

  3. Days allows the user to define the day of the month that the schedule will run. For example, the schedule will run on the 15th day of the selected month(s).

  4. Week In Month allows the user to define the week in the month that the schedule will be run. Options are First, Second, Third, Fourth or Last. Select Not Set if this option is not required.

  5. Days in Month allows the user to select the day in the month that the schedule will be run. In the example below, the schedule will run on the last Saturday of every month.

 

  1. In the Advanced Setting section, set the Repeat Task Every to '0' as it is not required for this feature.
  2. In the Advanced Setting section, set the Repeat Task Every to '0' as it is not required for this feature.
  3. Set the Seconds, Minutes or Hours field to None as it is not required for this option.
  4. Select the required option For Duration of.
  5. Enter the date and the time that the schedule will Expire.
  6.  


Simple Trigger


  1. Enter the Start Time for the schedule.
  2. If there is a defined End Time, enter the time in this field, otherwise leave the field blank and the interface will run continuously based on the other parameters.
  3. Enter the frequency in the Repeat Task Every field.
  4. Select the time frame in Seconds, Minutes or Hours field.
  5. There are two options in Trigger Repeat Mode. Repeat Indefinitely indicates that the schedule will continue to be run to infinity or until the schedule is disabled. Specified Count will run the schedule a specified number of times.
  6. If the Trigger Repeat Mode is set to Specified Count, enter the number of times the schedule is to run. Otherwise, leave the default value of '0'.
  7. Simple Trigger Misfire Instruction determines what will happen if the schedule cannot be run. None indicates that it will just run on the next cycle. Trigger Now indicates that the schedule will continue to determine if it can be run immediately after the initial schedule cannot run.

 

Scheduled Jobs

  1. Once the job schedule has been configured, the schedules can be viewed in Admin>System>Jobs Scheduled.
  2. Select the required job and click on the child grid to review the Triggers and Error Logs.