Creating a Task to Import Assets from an XML File

This topic explains how to create an integration task to import assets from XML files. This allows assets listed in XML files to be automatically registered in the organizational structure and kept updated.

Note that this task does not include importation of asset components.

The XML files may have specific structures for their headers, sections, content ID tags, and other elements. Different terminology may also be used to refer to the same properties. For example, the asset’s name in the XML file may be found in the "Asset Name" field, whereas in the system the field is called "Name". For the information to be imported correctly, the terms that appear in these files must be mapped to the corresponding fields in the system.

It may also be that a certain property of an asset is not included in the XML file, which may be problematic when the task is executed. If the field is optional in the system, there will be no error if it is left blank or is non-existent in the XML file. However, if a required field is not included in the XML file, an error will occur when the integration task is executed. To avoid this problem, a default value can be defined for each required field that is left blank or omitted in the XML files. Note that the XML file will ignore the configurations of custom attributes set as required in the Objects and Attributes section of this module, meaning that these required fields might be left blank.

If the assets registered in an XML file are the same as those registered in a different XML file to be integrated with the system through a second integration task, the information will not be consolidated and there will likely be duplicate assets reported for the imported objects.

Another feature that can be used in this mapping is the conversion of numbers, as it may be that in the file different scales are used than those used in the system. For example, in the file the criticality of the asset is scored on a scale from 1 to 10, whereas the system uses a scale from 1 to 5. In this case, rules must be created to convert these values. Values 1 and 2 can be converted to 1, values 3 and 4 can be converted to 2, and so on.

For details on mapping the fields required to import the file, see Appendix -> Mappings for Importing Assets from XML Files.

XML files can be imported directly from your local computer or from a remote repository. If you are using a SaaS environment, the XML files must be imported locally from your computer. 

The full XML file path must be provided if the file is located in a remote repository, such as a network path, a folder on the server, or an online file. If a file that has already been processed by the system is in the same directory as the new XML files, it will only be imported once. If the specified directory contains multiple unprocessed XML files, all of them will be imported. Therefore, specifying the order in which the files will be imported helps ensure that the latest information will be imported last. When you configure the integration task to import files from a remote repository, you can choose whether the files will be imported according to their creation date or their names.

You can also import XML files that are stored locally on your computer. In this case, the order the files are imported follows the alphabetical order of the file names. Keep in mind that tasks to import files stored locally are executed immediately after being saved, so you do not need to create a schedule for them.

The assets will be imported to a perimeter in the organizational structure. In the integration task, you can specify whether the assets will be imported to an existing perimeter, or if a new perimeter will be created for them.