Import User Documentation

The "Import" tool provides a command line interface for the import of transformations and jobs into a repository.

This utility was introduced in PDI version 4.2.0.

See also the concept: Lifecycle Management

Options

As mentioned you can specify a list of filenames to be imported after the specification of these options.  The files can be any file type that has transformations or jobs in them.  In other words, any XML file with <transformation> and <job> entries in them.

Return codes

Import returns the following error codes:

Examples

Import a single transformation into the repository:

sh import.sh -rep=RepName -user=joe -pass=password -dir=/ktr -norules "samples/transformations/Getting Started Transformation.ktr"

Import all transformations in a directory:

sh import.sh -rep=RepName -user=joe -pass=password -dir=/ktr -norules -filedir=/foo/ $( ls /foo/*.ktr )

Import a repository export with a rules file:

sh import.sh -rep=PRODUCTION -user=joe -pass=password -dir=/import -rules=prod-rules.xml \
             -file=UAT-export-20110616.xml -coe=false -replace=true \
             -comment="New version upload from UAT"

Rules

Beyond the general rules described above you have to provide an "import rules" file to the import utility.  The rules allow an administrator to make sure that the quality of the imported repository objects adhere to a certain standard.  Those among you that find the built-in rules to be insufficient can write and deploy new rules as plug-ins.  For more information see the PDI SDK.

To be valid for the Import utility, the XML described in the rules below need to be placed in an XML document with a parent <rules> element.

A transformation requires a description

Description: This rule verifies that all transformations have a description with a certain specified minimum length.

Rules file XML:

<rule>
        <id>TransformationHasDescription</id>
        <enabled>true</enabled>
        <min_length>20</min_length>
 </rule>

A job requires a description

Description: This rule verifies that all jobs have a description with a certain specified minimum length.

Rules file XML:

<rule>
        <id>JobHasDescription</id>
        <enabled>true</enabled>
        <min_length>20</min_length>
 </rule>

A transformation has to log to a transformation log table

Description: Verifies that each imported transformation has configured the transformation logging table appropriately.  It can also validate that the schema name, table name and connection name contain a certain standard value.

Rules file XML:

<rule>  
   <id>TransformationHasTransLogConfigured</id>
   <enabled>true</enabled>
   <schema_name/>
   <table_name/>
   <connection_name/>
 </rule>

A job has to log to a job log table

Description: Verifies that each imported job has configured the job logging table appropriately.  It can also validate that the schema name, table name and connection name contain a certain standard value.

Rules file XML:

<rule>
   <id>JobHasJobLogConfigured</id>
   <enabled>true</enabled>
   <schema_name/>
   <table_name/>
   <connection_name/>
 </rule>

Validate the configuration of the specified database

Description: Verifies that a database is configured according to the specification given.

Rules file XML: (copy the connection XML from the right click database connection menu in Spoon)

<rule>
    <id>DatabaseConfiguration</id>
    <enabled>true</enabled>
    <connection>
      <name>MySQL</name>
      <server>localhost</server>
      <type>MYSQL</type>
      <access>Native</access>
      <database>test</database>
      <username>foo</username>
      <password>Encrypted 2be98afc86aa7f2e4cb79ce10df90acde</password>
      <attributes>
        <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
      </attributes>
    </connection>
 </rule>

Transformation has no disabled hops

Description: Use this rule to make sure that there are no accidentally disabled hops in your transformations.

Rules file XML:

<rule>
    <id>TransformationHasNoDisabledHops</id>
    <enabled>true</enabled>
 </rule>

Job has no disabled hops

Description: Use this rule to make sure that there are no accidentally disabled hops in your jobs.

Rules file XML:

<rule>
    <id>JobHasNoDisabledHops</id>
    <enabled>true</enabled>
 </rule>

A transformation must have a note

Description: This rule makes it mandatory for a transformation to have at least one note for documentation purposes.

Rules file XML:

<rule>
    <id>TransformationHasANote<id>
    <enabled>true</enabled>
 </rule>

A job must have a note

Description: This rule makes it mandatory for a job to have at least one note for documentation purposes.

Rules file XML:

<rule>
    <id>JobHasANote</id>
    <enabled>true</enabled>
 </rule>