About the Network Integrity File Parser Processor

The file parser processor is a fully-implemented, code-generated processor that parses XML- and ASCII-delimited files into Java. The file parser processor outputs an iterable that the other processors can use to access the records and data in the file.

The file parser processor can be used in discovery, import, and assimilation actions.

For more information about file parsing, see Network Integrity File Transfer and Parsing Guide.

Related Topics

About Network Integrity Processors

Configuring Network Integrity File Parser Processors

Configuring Network Integrity File Parser Processors

This procedure assumes that the file parser processor has already been created and added to an action. You cannot configure the file parser processor unless it belongs to an action. See "Creating Network Integrity Processors" and "Adding Existing Processors to Network Integrity Actions" for more information.

The File Parameter field is mandatory and indicates what context parameter holds the reference to the files to be parsed at run time. The context parameter holding the file references must be output by a predecessor processor in the sequence of processors in the action. The processor outputting the file parameter is typically a file parser processor that has transferred the files from a remote system, but it can be any type of processor.

To configure a file parser processor:

  1. On the Processor editor Details tab, in the Parser Type field, specify the type of file to be parsed.

  2. In the File Parameter field, specify the input file parameter:

    1. Next to the File Parameter field, click Select.

      The Select Output Parameter dialog box appears, listing java.util.Collection.java.io.File context parameters output by predecessor processors in the sequence of processors in the action. If there are no available context parameters, an error message appears.

    2. Select a parameter.

    3. Click OK.

  3. Configure the file parser processor for the selected parser type:

  4. Add context parameters.

    See "About Context Parameters for Network Integrity Processors" for more information.

  5. Save the processor.

Related Topics

About Network Integrity Processors

Creating Network Integrity Processors

About the Network Integrity File Parser Processor

Network Integrity Processor Editor

Configuring Network Integrity File Parser Processor ASCII Settings

A file parser processor that is configured to parse ASCII-delimited files uses parsing rules, records, and field definitions to generate Java classes for accessing file data and to parse input files at run time.

To configure file parser processor ASCII settings:

  1. On the Processor editor ASCII tab, from the Record Delimiter list, select the delimiter type that indicates a new record.

  2. Do one of the following:

    • Import a list of record definitions. See "Importing ASCII Record Definitions to Network Integrity File Parser Processors" for more information.

      Caution:

      Importing record definitions removes all existing record definitions.
    • Create record definitions:

      1. In the Record Definitions area, click Add.

        The Create Record Definition dialog box appears.

      2. In the Name field, enter a name for the new record.

      3. Click OK

        Design Studio adds the record to the Record Definitions area.

      4. In the Record Definitions area, select a record and configure it.

        All the columns in the Record Definitions area are editable fields. See "Processor Editor ASCII Tab" for information about the fields in the Record Definitions area.

  3. Add field definitions to records:

    1. In the Record Definitions area, select a record name.

    2. In the Field Definitions area, click Add.

      The Create Field Definition dialog box appears.

    3. In the Name field, enter a name for the field definition.

    4. Click OK.

      Design Studio adds a field definition to the Field Definitions area for the selected record.

    5. In the Field Definitions area, select a field definition and configure it.

      All columns in the Field Definitions area are editable fields. See "Processor Editor ASCII Tab" for information about the fields in the Field Definitions area.

Related Topics

About Records for Network Integrity File Parser Processors

Configuring Network Integrity File Parser Processors

Network Integrity Processor Editor

About Records for Network Integrity File Parser Processors

You can specify multiple header, body, or trailer records. If two header records are defined, the first two records in the file are header records and must match the definition specified. Similarly for multiple body and trailer records: if four trailer records are defined, then the last four records defined in the file are trailer records. When specifying multiple records of the same record type, the order of the records becomes important.

You can either create record definitions or import record definitions from an ASCII file.

After a record is created, its fields become editable.

The file parser processor outputs an iterable for each record returned from the file at run time. The iterable can be used within a For Each processor so that the processor can be written to handle a single record at a time.

Related Topics

Configuring Network Integrity File Parser Processor ASCII Settings

Network Integrity Processor Editor

Importing ASCII Record Definitions to Network Integrity File Parser Processors

You can import record definitions from a sample delimited file to discover field names and to populate the record and field definitions.

Before importing record definitions, the sample file must conform to the following:

  • Sample files must have a header with field names.

  • Sample files cannot have empty header field names.

  • Field names must be unique. If the sample file contains duplicate field names, Design Studio displays a warning message and appends a prefix to the field names to differentiate them.

Note:

Importing ASCII record definitions only imports a single header record and matching body record. Any existing records and fields defined in the file parser processor are deleted. The created header record is marked as Ignored by default.

To import ASCII record definitions:

  1. From the ASCII Parser Definition area, click the Import button.

    The Import Sample ASCII File dialog box appears.

  2. (Optional) Change the following default values:

    • In the Header Record Name field, enter a name for the header record.

    • In the Body Record Name field, enter a name for the body record.

    • From the Field Delimiter list, specify a field delimiter.

      If you specify Custom, enter the custom field delimiter expression in the Custom Field Delimiter field.

  3. In the Sample File Path field, enter the path to the sample ASCII file to import.

    Click the Browse button to navigate to the location of the sample file.

  4. Click OK.

    Design Studio imports the sample ASCII file. The record definitions appear in the Record Definition Details area.

  5. Create trailer records.

    You cannot import trailer records. See "Configuring Network Integrity File Parser Processor ASCII Settings" for more information.

Configuring Network Integrity File Parser Processor XML Settings

A file parser processor configured to parse XML files uses an XML schema to generate an XMLBeans representation of the XML schema file to bind it to Java types.

Note:

It is recommended that you create a schemas directory in the project and put all XML schemas in this directory. If a different cartridge needs to parse different types of XML documents, defined by different schemas, you can create separate directories. For more information about XML schemas, see Network Integrity File Transfer and Parsing Guide.

To configure file parser processor XML settings:

  1. On the Processor editor XML tab for the file parser processor, next to the XML Schema field, click Select.

    The Select XML Schema dialog box appears.

  2. From the Matching Resources list, select the XML schema.

    You can filter the Matching Resources list by typing in the Select a resource to open field.

    Only schemas that are in the current project appear in the Select XML Schema dialog box.

  3. Click OK.

    Design Studio displays the relative path to the schema in the XML Schema field.

  4. Save the processor.

Note:

If your XML Schema file contains import elements that do not specify the schema location, and if you are working in an environment that uses a proxy server for HTTP access, you must configure the proxy settings for Design Studio. See Design Studio System Administrator's Guide for more information.

Schemas sometimes import other schemas. You may need to include imported schemas in the project at the correct directory.