Adding custom imports

Litium Integration Kit allows adding additional scheduled tasks for custom imports. 

Implementing a custom scheduled task

New tasks should inherit from

public abstract class FileImportBase<T>

where T is the type of the object to import.

 

Required methods to implement from FileImportBase 

protected override IEnumerable<Item> Transform(FileInfo importFile)

This method is used to transform file-data into the Item class collection. The Item class is a POCO object that carry data to the Import method. Note that the Transform method returns a collection of Item objects.

protected override void ProcessItem(Item item)

This method is used to implement the main logic of importing data from the Item object into the Litium Studio structure.

 

Optional methods to implement from FileImportBase

protected override bool PrepareProcess(FileInfo importFile)

This method is used to implement preparation process logic such as read files, fetch  Litium Studio related data or entity.

protected virtual void PostProcess(FileInfo importFile)

This method is used for post-processing logic.

 

Processing workflow for integrations

With the methods from FileImportBase implemented the whole process of importing data into Litium Studio is as follows:

  1. Prepare file, reading from disk etc. (PrepareProcess)
  2. Transform data from file into Item object (Transform)
  3. Process data, importing data into Litium Studio (ProcessItem)
  4. Final post-import procedures, deleting import file, move to another folder etc.