IMPORT

This action imports the contents of the comma delimited text file (CSV) and creates or modifies instances of the specified business object.

IMPORT Id() ( FROM | FROM XML ) ArithmeticOperation()

where Id() is the identifier of the business object to be imported and the ArithmeticOperation() is the expression identifying the name of the import file. The result of the arithmetic operation must be a string. For example:

IMPORT PersonalSavingAccount FROM 'c:/mydocuments/psa.csv' 

If FROM XML keyword is used the identifier indicates the XML string to import from, rather than the name of the import file.

The following options can be used with the action:

  • IN BATCHES OF IntegerLiteral()

If the action is likely to import many instances of the business object (hundreds or even thousands) their processing may take a while. In this case it is better to perform processing in smaller chunks (batches). After the processing of each batch finishes the results are immediately committed to the system and stored in the database. If the batch size is not specified the system will only commit the results once all instances have been processed. For example:

IMPORT PersonalSavingAccount FROM 'c:/mydocuments/psa.csv' IN BATCHES OF 100 
  • WITH VALIDATION

If this keyword is specified any rules associated with the business object being imported will be executed. If this option is omitted, the instances of the business object will be stored in the system but any rules associated with the business object will not be executed. If any rule fails for some record in the import file, this record will be ignored. For example:

IMPORT PersonalSavingAccount FROM 'c:/mydocuments/psa.csv' WITH VALIDATION 

note

This option will slow down the import process considerably and is recommended when import files are not too large. On the other hand using this option will guarantee that only valid instances of the business object are stored in the system.

note

First line of the input file must contain the description of the imported attributes. If this description contains the ID attributes, the system will look for the specified instances and modify them with the supplied data, otherwise new instances will be created.
  • KEEP RESULTS

If this keyword is specified imported objects will stay in the Context and will be available for further processing by rules. This option is not recommended if large number of objects is being imported.

  • CREATE IF NOT FOUND

If this keyword is specified the import file can be used both to update existing records and create new ones. If a record referred to in the file is not found Aware IM will create a new record.

See also the “Export and Import” section.

  • USING

If this keyword is specified an import is performed using one of the user-defined import templates, for example:

IMPORT PersonalSavingAccount FROM 'c:/mydocuments/psa.csv' USING 'My import template' 
  • ENCODING

This keyword specifies encoding of the imported file, for example:

IMPORT PersonalSavingAccount FROM 'c:/mydocuments/psa.csv' ENCODING UTF-8' 

The default encoding is UTF-8.

  • Last modified: 2023/05/09 01:37