ISM Manual
  • Overview
  • Features
  • Components
  • Directory Structure
  • Startup/Shutdown
  • ISM Admin UI
    • Dashboard
    • Flow
    • Job
      • Schedule
    • Channel
      • AMQP
      • Mqtt
      • sFTP
    • Interface
      • System
      • Data Structure
      • Field Group
      • Field
    • Web Service
    • Utility
    • Admin
    • Result
  • Tasks
    • Control Task
      • Route
      • Split/Join
      • Mapping
    • FTP
      • FTP Input
      • FTP Output
      • FTP Transfer
    • DB
      • SQL Executor
      • SQL Batch Executor
    • File
      • File Input
      • File Output
      • File Validator
      • Record Extractor
    • Excel
      • Excel Reader
      • Excel Writer
    • Flow
      • Flow Execution
      • Wait Sub
    • Web Service
      • REST Client
      • Web service Client
    • PGP
      • Encrypt
      • Decrypt
    • Cloud
      • SharePoint
      • Amazon S3
      • Google Cloud Storage
    • Others
      • Email Sender
      • LDAP Client
      • Function
      • Script
      • Java Class
  • REST Service
  • Trouble Shooting
  • Logging Configuration
  • Implementing a Task
  • Custom Class
  • Frequently Asked Questions (FAQ)
    • What is XNARUM Integration Service Mastery (ISM)?
    • What is the purpose of XNARUM?
    • Can XNARUM be customized to specific integration requirements?
    • Is XNARUM scalable?
    • Does XNARUM provide support and maintenance?
Powered by GitBook
On this page
  • Input
  • Output
  • Example
  • File To DB
  • File Input
  • Mapping
  • SQLBatchExecutor
  1. Tasks
  2. File

File Input

PreviousFileNextFile Output

Last updated 1 year ago

The FileInput component is used to load data from files, and it can parse the contents of the file against a predefined data structure. This helps to ensure that the data being loaded is in the correct format and meets the required criteria before further processing is carried out.

Input

Attribute
Description

Input Path

Input directory

Input File

Input file. File name can contain wild card (*).

Suffix Allowed

Extension list delimited with comma(,).

ex) *.txt, .dat ??? files with txt extension or dat extension will be loaded.

(*) Input File and Suffix Allowed are not mutual exclusive. Files which match either conditions are loaded.

Wait Seconds

Wait time in seconds until the file is not modified. Default seconds is 5 seconds.

Contents Type

The type of loaded contents.

· Byte array

· String

· ISM data

The default option is byte array. If ISM data is chosen, the contents are parsed against the predefined data structure. And this data structure comes from the Output property

Ignore File Not Found

Action when the input file is not found.

· Ignore

· Throw error

After Get

Action after the input file(s) are loaded.

· Do Nothing

· Backup

· Delete

Backup Path

Backup directory if the After Get action is backup.

Output

Attribute
Description

FileContents

Contents of the input file(s). Contents are storead as byte array

DataStructureId

Data structure id for mapping

FileInfos

File list. This attribute contains java.io.File objects

UseMapping

If Use in mapping is yes, remove the default value and set a different value.

Example

File To DB

In this scenario, a source file containing data needs to be synchronized with a target database table. The source file has six columns: id, birth date, first name, last name, gender, hire date, and the target table has the same columns.

The flow starts with the FileInput task, which reads the source file and passes the data to the Mapping component. The Mapping component is used to transform the data into a format that can be inserted into the target table. In this case, it simply maps the source columns to the target columns with the same name.

Next, the SQLBatch task is used to execute a batch insert statement to insert the transformed data into the target table.

If the input file has a header line, the first row of data may be treated as invalid data or it may cause the data to be incorrectly mapped to the output. Therefore, it is recommended to remove the header line before processing the input file.

File Input

Attributes

Description

Input Path

Assign input directory

Input File

Assign file name ??? only one file is allowed

Suffix Allowed

-

Wait Seconds

1

Contents Type

Data

Ignore File Not Found

-

After Get

-

Backup Path

-

The input file is parsed against the data structure and stored in the parameter called MyEmployees. The parsed data is stored in a file backed list to avoid OutOfMemory issue.

Mapping

Mapping does simply connect the input fields to the correspondent output fields.

SQLBatchExecutor

SQLBatchExecutor gets input data from MappingResult.

Data structure

Input file

Target database