Import API events

The Import API raises events that display information about the progress of an import job and any errors that occur.

This page contains the following information:

OnComplete

This OnComplete event occurs when an import job is finished. A JobReport object is passed with detailed information about the job. A completed job may have errors if the data wasn't imported properly. JobReport has the following public properties:

OnError

OnError contains a single parameter named Row, which is declared as an IDictionary. This event is raised when an error occurs while importing a row of data. The MaximumErrorCount is a configurable setting available on all import jobs that determines the number of errors to return.

If you are using the ImportBulkArtifactJob class, the Row parameter contains the following key-value pairs for each record that causes an error and fails to be imported:

If you are using the ImageImportBulkArtifactjob class, the Row parameter contains the following key-value pairs for each record that causes an error and fails to be imported:

OnFatalException

The OnFatalException event is raised when an import job encounters a fatal exception caused by invalid import settings or other issues. It passes a JobReport object with detailed information about the exception.

OnMessage

The OnMessage event is used to programmatically monitor the progress of an import job. It contains a Status parameter, which contains a Message property. The Message property returns values that indicate the progress of the import job, and can be displayed to users. This message is similar to those used in the Relativity Desktop Client.

OnProgress

The OnProgress event is raised for each row found in a data set:

The event reports the line number of the row in the load file or image file.

OnProcessProgress

You can attach the OnProcessProgess event to import jobs. The OnProcessProgess event is triggered at the same rate as the OnMessage event, but instead of the single Message property of the Status object provides detailed information about the underlying import process as the properties of the FullStatus object.

The properties include:

You can use the event in more complex workflows, for example, to get information across multi-threaded imports or create a progress bar.

Example use:

importJob.OnProcessProgress += status => Console.Writeline(status.StartTime);
importJob.OnProcessProgress += status => Console.Writeline(status.EndTime);
importJob.OnProcessProgress += status => Console.Writeline(status.ProcessID);
importJob.OnProcessProgress += status => Console.Writeline(status.TotalRecords);
importJob.OnProcessProgress += status => Console.Writeline(status.TotalRecordsProcessed);
importJob.OnProcessProgress += status => Console.Writeline(status.TotalRecordsProcessedWithWarnings);
importJob.OnProcessProgress += status => Console.Writeline(status.TotalRecordsProcessedWithErrors);
importJob.OnProcessProgress += status => Console.Writeline(status.TotalRecordsDisplay);
importJob.OnProcessProgress += status => Console.Writeline(status.TotalRecordsProcessedDisplay);
importJob.OnProcessProgress += status => Console.Writeline(status.StatusSuffixEntries);

Community Updates

Aero Developer FAQ Evolving the Platform Most recent release notes
Learn more Learn more Learn more

Additional Resources

   
Access Third-Party Tools with GitHub     Create .NET Apps Faster with NuGet
Visit github     visit nuget