DataImporter - Import CI Relations

SHOW ALL CONTENT

Table of contents

Overview

Importing the relationship between CI allows to relate two or more CI together and add a comment about the relationship. Before you can do this type of import, the CI to relate must be imported along with the relation types.
 

References

 

What you need to know:

The reference template files (.xlsx et .xml) to prepare imports are included in the CI_EN.zip file.

Required Fields

  • CI1 – Text (125)
  • CI2 – Text (125)
  • Relation
    • Name of the relationship between both CI
    • The relationship must already exist in the two CI types before proceeding to the import
    • To manage CI relations, you must:
      • Ensure that the relation type exist from the Tools > Reference Data Management.... > CI > Relationship types menu
      • Ensure that both CI types have a relationship from the Tools > Reference Data Management.... > CI > Types menu > select one of the CI and add the relationship type from the relationship tab

Optional Fields

  • Note - Text (2000)
    • Represents the relationship note.

Configuration File (XML)

The declaration of the source is done by indicating the CIRelation value in the <Content> tag. 

NOTE: The XML file used as this example is for an import done from Excel 2007 or 2010. To explain the tags used in all types and to find out more about the types of files, please refer to the XML Configuration File article.

 

<?xml version="1.0" encoding="utf-8" ?>

<Sources>

     <Source Name="Import CI Relationship">

          <ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\Import\CI.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES";</ConnectionString>

          <ViewName>[Import Relationship$]</ViewName>

          <ManageRelations>False</ManageRelations>

          <Content>CIRelation</Content>

          <EmptyValueHandling>NoChange</EmptyValueHandling>

     </Source>

</Sources>

Information on Additional Tags

To import CI relationships, The XML file used can contain 2 additional tags. These tags are not mandatory and when they are not specified the default value will be used.

What you need to know:

The additional tags are case sensitive.

If the value is not written exactly the way it is documented, Octopus will ignore the tag and use to the default value. 

Deleting Relationships That No Longer Exist Between Two CI

In the declaration of the database source (XML file), it is possible to manage the suppression of the relation between CI. 

How the option works:

  • When you activate this option, you must absolutely make sure that the name of the Source Name in the XML file is always the same for a similar import, but always different for each imported source
  • When the relation between two CI is no longer part of the data source, the system will delete it at the next import.

To use this tag, add the following line to the XML file:

<ManageRelations>VALUE</ManageRelations>

Management of Empty Fields

DataImporter can help clean the data contained in Octopus when empty fields are encountered. If this tag is not present, the NoChange default value will be used. 

If you want to use this tag as part of an import, it is important that your data source only contain columns to act on. DataImporter will systematically try to clean all these columns. You can clean all fields except:

  • Required fields
  • Fields that have been configured as mandatory in the Octopus database
  • Fields that accept only specific values, for example Boolean type fields (yes/no)

Permitted values for the EmptyValueHandling tag:

  • Clear: The existing value in Octopus will be cleared and the field will be empty
  • NoChange (Default Value): Fields that are empty in the data source being imported will be ignored and the existing value in Octopus will be kept.


To use this tag, add the following line to the XML file : 

<EmptyValueHandling>VALUE</EmptyValueHandling>
X
Help us improve our articles








Help us improve our articles