Import scripts

About import behavior

Before importing a document, AccountingIntegrator searches for an existing Collection with the same identifier. The Collection identifier is defined in the Collection Type and includes a list of Collection properties. If a Collection already exists with the same identifier, AccountingIntegrator behaves as follows depending on the number entered for the import mode parameter:

  • 1: Reset
    The properties of the Collection are overwritten with the properties of the incoming property file. The data file is not imported.
  • 2: Reject
    Import is rejected and an error is raised. The error code is set to Already Exists.
  • 3: Child
    A new Collection is imported and becomes the child of the existing Collection. A child Collection is a standard collection that keeps a link to a parent collection using a Parent property.
  • 4: New
    A new Collection with the same identifier is created. It becomes the default value.
  • 5: Merge
    The content of the incoming Collection is added to the existing Collection.

Import scripts

Script Description
importDocument

Imports a Document and associated files into AccountingIntegrator.

The Collection Type selection configuration is used to find the right Collection Type to apply. The selection will be based on the collection properties and the validity period. The chosen Collection Type definition provides AccountingIntegrator with all the settings needed to import the document.

Parameters

  • ImportDocPropertyFile: Path to the properties file.
  • ImportDocDataFile: Path to the data file.
  • ImportDocErrorFile: Path to the error file. This parameter is oly used when importing XML files.
  • ImportDocExternalId: External identifier that can be given to the collection.
  • ImportDocMode: Import mode index that defines the strategy to apply when a collection with the same identifier already exists.
  • ImportDocStatus: Status for the collection to create.
  • ImportDocChangeStatusAuthor: User name that must be used for the Change Status Author property in the Collection.
  • ImportDocModifState: (Optional) Modification state of the document. Possible values are Untouched and Added. The default value, Untouched, indicates that the document cannot be deleted from the database.
importDocuments

Imports all the documents from a folder into AccountingIntegrator.

Parameters

  • ImportDocsFolder: Absolute path to the folder that contains documents.
  • ImportDocsMode: (Optional) Import mode index that defines the strategy to apply when a Collection with the same identifier already exists.
    Possible Values:
    • 1:RESET
    • 2: REJECT
    • 3: CHILD
    • 4: (default value): NEW
    • 5: MERGE
  • ImportDocsStatus: (Optional) Status for the Collection to create. By default the value is the first status in the lifecycle list of status.
  • ImportDocsChangeStatusAuthor: (Optional) User name that must be used for the Change Status Author property in the Collection. By default, the value is the connection user name.
  • ImportDocsLanguage: (Optional) Language for the imported file. By default, the value is english .
  • ImportDocsValidExtendions: (Optional) Valid extensions for the data files. By default, the value is xml .
  • ImportDocsModifState: (Optional) Modification state of the document. Possible values are Untouched and Added. The default value, Untouched, indicates that the document cannot be deleted from the database.

importDocumentByBCollectionType

Imports a Document and associated files into AccountingIntegrator. The Collection Type here is not based on the Collection Type selection configuration but directly provided in the command.

Parameters

  • ImportDocByBCollectionTypeBCollectionTypeName: name of the Collection Type.
  • ImportDocByBCollectionTypeBCollectionTypeVersion: version of the Collection Type.
  • ImportDocByBCollectionTypeDataFile: path to the data file.
  • ImportDocByBCollectionTypeErrorFile: path to the error file. This parameter is only used when importing XML files.
  • ImportDocByBCollectionTypeExternalId: external identifier for the Collection.
  • ImportDocByBCollectionTypeMode: import mode index. As no property file is provided, no custom identifier can be computed for the Collection and by default the only possible mode is New except if you set the External Identifier system property as Collection identifier. In this case, all import modes can be used.
  • ImportDocByBCollectionTypeStatus: status for the Collection to create.
  • ImportDocByBCollectionTypeChangeStatusAuthor: user name that must be used for the Change Status Author property in the Collection.
  • ImportDocByBCollectionModifState: (Optional) Modification state of the document. Possible values are Untouched and Added. The default value, Untouched, indicates that the document cannot be deleted from the database.

Related Links