IMPORT

Use the IMPORT script function to import objects or folder structures from an XML file.

When you import the content, a new folder ##INCLUDED_EXTERNALS## is created on the same level as the dedicated folder on the target system. Linked objects are stored in the ##INCLUDED_EXTERNALS## folder.

The default size of the XML file is 1024 KB, with a maximum file size of 30720 KB. Administrators can specify a different MAX_IMPORT_SIZE limit. For more information, see UC_SYSTEM_SETTINGS - Systemwide Settings.

Notes:

  • Do not use IMPORT for mass transport. Use the Transport Case when you need to move large amounts of content. For more information, see Transporting Data.
  • Objects are created in the specified folder. If there is no such folder or if the parameter is missing, the objects are stored in <No folder>.
  • Non-folder objects are not treated as objects during import. Import settings apply to folder objects only.
  • You must have write access to the object or target folder. If you do not have sufficient permissions, the import fails. For more information, see Granting Automation Engine Authorizations.
  • This script function writes all open transactions of the script to the AE database. For more information, see Script Processing.
  • Information about the import is stored in the activation report of the object that calls the import.

Important!

  • Imports to the Version Management folder are not permitted.
  • In distributed AE environments, work processes run on different computers. You must define on which computer the export is made.
    • (Windows) Specify the UNC path under Windows. The server should run under an appropriate domain user so that the UNC names can be accessed.
    • (UNIX) Indicate the absolute path in UNIX notation.
  • The file system needs to be accessible (NFS; mount command) but it is not important on which computer it is located. This is the only way to assure that the actually required file is used.

Syntax

IMPORT (File [,[Folder], [Object Setting] [,Link Setting]] )

Parameters

  • File
    Name of the file (with full path specification) to import
    Format: script literal or script variable

  • Folder
    Name of the folder to store the imported content in
    Format: script literal or script variable

  • Object Setting
    Skips or overwrites existing content
    Format: script literal, script variable, or number
    Allowed values:

    • 0
      Skips existing objects
    • 1 (default)
      Overwrites existing objects or folders

  • Link Setting
    Ignores or keeps existing folder links or external objects
    Format: script literal, script variable, or number 
    Note: The parameter is only relevant when you set the Object Setting to 1.
    Allowed values:

    • 0
      Ignores existing folder links and external objects
    • 1 (default)
      Keeps existing folder links, and imports external objects


Return Codes

  • 0
    Successful import
  • 20657
    Target folder does not exist
  • 20692
    File does not exist
  • 21724
    File access is not possible due to missing authorization
  • 21729
    Import not possible: XML file to import does not have the required AE format
  • 21730
    The imported XML file does not meet the required encoding
  • 21732
    Error occurred during import - see activation report for details

Tip: Use the :ON_ERROR script statement to define action to take if the import fails. For more information, see Script Elements for Error Handling.

Examples

The following example skips objects that already exist in the import process. The script uses a script variable to pass the file and folder name to the IMPORT function.

:SET &FILE#  = "\\PCUC4\UC4global\IMPORT\uc4_import.xml"
:
SET &FOLDER# = "IMPORT/JOBS"
:
SET &RET#    = IMPORT(&FILE#,&FOLDER#,"0")

(UNIX) The following example imports a folder structure:

:SET &FILE#  = "/opt/UC4/import/uc4_import.xml"
:
SET &FOLDER# = "IMPORT/JOBS"
:
SET &RET#    = IMPORT(&FILE#,&FOLDER#,"0")

See also:

seealso

Importing/Exporting Objects