Skip to content
Peter Garas edited this page Oct 2, 2023 · 1 revision

Adding your own Loader

You can add your own Loader that can sync data from your Knowledge Management System. You need to create a data loader class that implements the Loader interface. The loader class is a simple Task. It should implement two methods: initialize and run.

The initialize method is called by the app with the configuration and the two adapters (source and destination). This method can perform any preparation the task needs. It should return a Promise which is awaited. Then the app calls the run method with the previous Loader's result. This method's result will be passed to the next task which can be either another Loader or a Processor.

The sample data loaders are split into 3 layers:

  • Loader
  • Adapter
  • API

The API class has all the methods to interact with the other system, it can fetch data from or send data to it.
The Adapter contains all the logic to get the necessary data using the API class.
The Loader collects and transforms all the entities to a normalized format (ExternalContent). In this format, the Aggregator can calculate differences between the current and the already uploaded data.

Clone this wiki locally