FTP Rename File activity

Use the FTP Rename File activity to rename and/or move a file to a different directory, during run time.

The directory that the FTP Rename File activity renames is shown in the following supported cases: For an example project that uses an FTP Rename File activity, see the Parse Directory Listing Example: Parse directory listing example.

Symbolic link

The FTP Rename File activity supports symbolic links to directories if the following conditions are true: To determine the specific symbolic link support for a specific FTP Server on a specific operating system, see your operating system and FTP Server documentation.

Adding an FTP Rename File activity in the orchestration

  1. Create or open an orchestration. A graphical representation of the orchestration is displayed.
  2. Select the Activities tab and expand the FTP folder.
  3. Drag the Rename File activity onto the orchestration.
  4. Select the activity. The Checklist is displayed.

Creating, selecting, or editing an FTP endpoint

  1. Click Pick Endpoint task from the Checklist and choose from one of the following actions:
    • Select an existing endpoint:
      1. Select Browse. The Project Explorer is displayed.
        Attention: Specifying a new FTP Endpoint with a different directory structure than the original FTP Endpoint can cause the orchestration job to fail during run time. You must either specify a new FTP Server that matches the directory structure of the originally specified FTP Server or change the configured directory of the In Directory field by clicking Browse as described below in the "Configuring the activity" procedure.
      2. Select an existing endpoint and click OK. Go to the "Configuring the activity" procedure
    • Select an existing endpoint and edit the endpoint:
      1. Select Browse. The Project Explorer is displayed.
      2. Select an existing endpoint and click OK.
        Attention: Specifying a new FTP Endpoint with a different directory structure than the original FTP Endpoint can cause the orchestration job to fail during run time. You must either specify a new FTP Server that matches the directory structure of the originally specified FTP Server or change the configured directory of the In Directory field by clicking Browse as described below in the "Configuring the activity" procedure.
      3. Click Edit. The Edit Endpoint pane is displayed.
    • Create a new endpoint: Select New. The Create Endpoint pane is displayed.
  2. Create or edit an FTP endpoint: Creating or Editing an FTP endpoint

Configuring the activity

  1. Select the Configure task from the Checklist. The Configure pane is displayed.
  2. Configure the fields in this pane as described in the following table:
    Table 1.
    Field Description
    Rename  
    File Named This field is not used for this activity. You specify the name of the file to rename using the fromFilename input parameter of the Map Input task.
    From Directory Specifies the directory on the FTP server where the Integration Appliance deletes the specified file. You can specify a directory using one of the following options:
    • Directly enter directory path by clicking in the field and typing in one of the following directory paths:
      • Relative directory path, for example: /process.  (Assumes that FTP home has been configured for the user account that connects to the FTP Server. See the note below for more information.)
      • Complete directory path, for example on a UNIX machine: /home/user/process.
    • Click Browse... to populate the drown-down list of available directories. Select the appropriate directory from the drop-down list.
    Note: UNIX: If you specify a relative directory path when connecting to an FTP Server on a UNIX machine, verify that the FTP home directory has been correctly specified in the /etc/password file for the user account connecting to the FTP Server.
    New Path This field is not used for this activity. You specify the full path including the new filename and the new directory on the FTP server, where the Integration Appliance puts the file that has been moved using the toPathinput parameter of the Map Input task.
    Note: UNIX: If you specify a relative directory path when connecting to an FTP Server on a UNIX machine, verify that the FTP home directory has been correctly specified in the /etc/password file for the user account connecting to the FTP Server.
    Options - Select one of the following options to define the behavior when a existing file of the same name already exists in the specified output directory:
    Overwrite Existing File if Duplicate File Name is Found Specifies if the file already exists, destroys the contents of the original file with new data returned from the activity.
    Raise Error if File with Duplicate Name is Found Specifies if the file already exists, keeps the original data in the file, throws an error, and does nothing with the new data returned from the activity.

Specifing the retry options

  1. Select the Retry task from the Checklist. The Retry pane is displayed.
  2. Configure the retry options for connecting to an FTP Server. The following table describes the retry options for connecting to an FTP Server:
    Table 2.
    Field Description
    Retry  
    1) Wait ___ second(s) between each retry. The number of seconds that the Integration Appliance waits before trying to establish a connection to the FTP Server.
    2) Try to connect ___ times before failing. Specifies the retry count - the maximum number of times the Integration Appliance attempts to establish a connection to the FTP Server before issuing an error and stopping the processing of the current orchestration job.

    If you deploy an orchestration that contains an FTP Rename File activity and the Integration Appliance cannot connect to the specified FTP Server, the Integration Appliance logs the connections errors as warnings in the system and orchestration logs until the retry count value is reached. When the retry count is reached, the Integration Appliance logs an error in the system and orchestration logs and the stops processing the current orchestration job.

    For example, you set the retry count to 3. The first, second, and third connection errors appear in the system log as warnings. The Integration Appliance logs the fourth connection error as an error and stops processing the current orchestration job.

Mapping the input of the activity

  1. Select the Map Inputs task in the Checklist. The Retry pane is displayed. The input parameters of the activity are displayed in the To Activity pane.
  2. You must map a variable to the following input parameters:
    • fromFilename - During a rename action, this parameter specifies the original name of the file to rename.
    • toPath - During a rename action, this parameter specifies the path including both the new directory name and the new name of the file. For example to specify that the file be moved to the /output directory of the root of the FTP Server using the fileNewName.txt filename, specify the following value for toPath: /output/fileNewName.txt

      All other input parameters are optional. See Creating a Map for general instructions on mapping.  

      If the input parameter listed in the following table are not displayed in the To Activity pane of the Map Inputs pane, select Map > Show Optional Parameters from the toolbar menu or right-click in the To Activity pane and select the Show Optional Parameters option. If the Map > Show Optional Parameters option is not selectable in the toolbar menu, click on a node in the Map Inputs pane to make this option active.

      You can optionally override the settings you specified in the Configure and Pick Endpoint task of the Checklist dynamically during run time, using the input parameters defined in the following table.

      For example, the directory on the FTP Server where the Integration Appliance places the file generated in this activity, could be set in the Configure task to the directory called output. During run time, the directory name: outputXML could be passed into the activity using the directory input parameter. The directory name specified dynamically during run time overrides the original setting specified in the Configure pane. In this example, the file would be placed in the outputXML directory.

      Table 3.
      Input Parameter Name/Node Description Overrides the Setting in Task?
      fromDirectory Specifies the directory on the FTP server where the Integration Appliance gets the list of files. The directory input parameter overrides the In Directory field of the Configure task.
      overwrite Specifies the amount of time in seconds before a timeout occurs between the Integration Appliance attempting to establish a connection to the endpoint and the time it takes for the endpoint to respond to the connection request. For the FTP List Files activity,  the amount of time the Integration Appliance attempts to establish a connection to the FTP Server before timing out. The timeout node of the connection input parameter overrides the Connection Timeout -Time out after ___ second(s) when establishing a connection to the Endpoint field of the FTP endpoint.
      connection/timeout Specifies the Host Name or IP address for the FTP server. The timeout node of the connection input parameter overrides the Connection Timeout -Time out after ___ second(s) when establishing a connection to the Endpoint field of the FTP endpoint.  
      connection/host Specifies the port number for the specified host name. The standard port for FTP traffic is 21. The default port for SFTP traffic is 22. The host node of the connection input parameter overrides the Host Name field of the FTP endpoint.
      connection/port Specifies the port number for the specified host name. The standard port for FTP traffic is 21. The default port for SFTP traffic is 22. The port node of the connection input parameter overrides the Port field of the FTP endpoint.
      connection/username Specify a user name for the account used to connect to the FTP Server. The username node of the connection input parameter overrides the User Name field of the FTP endpoint.
      connection/password Specify a password for the account used to connect to the FTP Server. The password node of the connection input parameter overrides the Password field of the FTP endpoint.

Mapping the output of the activity

  1. Select the Map Outputs task in the Checklist. The directoryListing or fileListing output parameters is displayed in the From Activity pane.
  2. Map the directoryListing or fileListing output parameter to a variable. See Creating a Map for general instructions on mapping.

    During run time, the FTP List Files activity returns the list of files to the orchestration using the directoryListing or fileListing output parameter.

    If the List Only Files (NLST) check box is cleared in the Configure task, a full directory listing including directory permissions, timestamps, and ownership is returned in the directoryListing output parameter as a single string. When a full directory listing is returned as a string, you must parse the directory listing using a Flat File Schema with the Read Flat File activity. You can create a Flat File Schema using the Flat File Schema Editor. For an example orchestration parsing a directory listing using a Flat File Schema, see the Parse Directory Listing Example: Parse directory listing example.

    If the List Only Files (NLST) check box is selected and the FTP List Files activity supports the format of the directory listing for your FTP Server, a repeating structure of just filenames is returned in the fileListing output parameter. When a repeating structure of filename is returned, you do not need to parse the directory listing and can just iterate through the list using a For Each or While Loop activity.