Script Function: Imports objects from an XML fileA format for imports and exports. An XML file contains object structures..
IMPORT(File [,[Folder], [Object Setting], [Link Setting]])
Syntax |
Description/Format |
---|---|
File |
File name with full path specification for the objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task import. |
Folder |
Name of the folderTop level entities such as Environment, Deployment Target, Activity, … are stored in folders. The permissions a user has on an entity depend on the permissions that are set on the folder for the entities. in which the objects should be stored. |
Object Setting |
Setting for the handling of existing objects. Allowed values: "0" (default value), "1" |
Link Setting |
Setting for the handling of existing folder
links or external objects. Allowed values: "0", "1"
(default value) This parameter is only relevant when the Object Setting "1" is selected. |
Return codes |
---|
"0" - Import process was successful. |
This script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… can be used to import objects or folder structures from an appropriately formatted XML file.
Do no use the import and export function for mass transports. Use the Transport Case for this purpose.
When you import folder structures, the XML file will contain folder structure information at the top of the file. During import, all folder and non-folder objects, linked objects as well as sub-folders are included and a new folder ##INCLUDED_EXTERNALS## will be created on the same level as the dedicated folder on the target system. Linked folder and non- folder objects will be stored in the ##INCLUDED_EXTERNALS## folder.
Non-folder objects are not treated as objects during import. Therefore import settings apply only to folder objects.
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>.
You can use the script statement :ON_ERROR in order to determine the reaction to an erroneous import. You can still use the script functions for error handling in order to analyze the import. Script processing continues. You can also cancel processing.
The XML file's standard size is 1024 KB, the maximum file size is 30720 KB. The administrator can specify a different size in the key "MAX_IMPORT_SIZE" of the variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. UC_SYSTEM_SETTINGS.
More detailed information about the import process is written to the activation reportA report provides more detailed information about a task's execution or a component. of the object that calls the import.
The import process fails if you do not have a write access to the object or the target folder.
Attention: Imports to the folder "Version ManagementThis refers to an object version that is stored when you have modified the object." are not allowed.
In a distributed AE environmentAn Environment consists of Deployment Targets which represent your endpoints. Different environments are used for different phases in the software delivery cycle, for example Development, QA, Staging, Production. An environment is typically set up once and used by several applications. (work processes run on different computers) you cannot determine the computer on which the import takes place. Automic recommends specifying the UNC path under Windows. Note that the Server must run under an appropriate domain userIn the Automation Engine, a user is an instance of a User object, and generally the user is a specific person who works with Automic products. The User object is assigned a user ID and then a set of access rights to various parts of the Automation Engine system and product suite. These access rights come in the form of Automation Engine authorizations and privileges, Decision user roles and EventBase rights and ARA web application object rights. You can manage all these centrally in the ECC user management functions. See also, Unified user management. so that the UNC names can be accessed. If you use a UNIX Server, you must specify the absolute path in UNIX notation. The file system must also be accessible (NFS; mount command) but it is irrelevant on which computer it is located. Doing so is important in order to ensure that the required XML file is used.
This script statement causes all the script's open transactions to be written to the AE databaseA database is an organized collection of data including relevant data structures..
The following example skips objects that already exist in the import process. File and folder name are passed on to the script function as a script variable.
:SET &FILE# =
"\\PCUC4\UC4global\IMPORT\uc4_import.xml"
:SET &FOLDER# = "IMPORT/JOBS"
:SET &RET# =
IMPORT(&FILE#,&FOLDER#,"0")
Example for importing a folder structure:
Example for UNIX:
:SET &FILE# =
"/opt/UC4/import/uc4_import.xml"
:SET &FOLDER# = "IMPORT/JOBS"
:SET &RET# =
IMPORT(&FILE#,&FOLDER#,"0")
See also:
Script element | Description |
---|---|
Exports objects to an XML file. |
Script Elements - Handle Objects
Importing and Exporting Objects
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function
Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support |
Copyright © 2016 Automic Software GmbH |