use of org.hisp.dhis.dxf2.events.enrollment.ImportEnrollmentsTask in project dhis2-core by dhis2.
the class EnrollmentController method startAsyncImport.
// -------------------------------------------------------------------------
// HELPERS
// -------------------------------------------------------------------------
/**
* Starts an asynchronous enrollment task.
*
* @param importOptions the ImportOptions.
* @param enrollments the enrollments to import.
*/
private WebMessage startAsyncImport(ImportOptions importOptions, List<Enrollment> enrollments) {
JobConfiguration jobId = new JobConfiguration("inMemoryEventImport", ENROLLMENT_IMPORT, currentUserService.getCurrentUser().getUid(), true);
taskExecutor.executeTask(new ImportEnrollmentsTask(enrollments, enrollmentService, importOptions, jobId));
return jobConfigurationReport(jobId).setLocation("/system/tasks/" + ENROLLMENT_IMPORT);
}
Aggregations