Search in sources :

Example 1 with ImportEnrollmentsTask

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);
}
Also used : ImportEnrollmentsTask(org.hisp.dhis.dxf2.events.enrollment.ImportEnrollmentsTask) JobConfiguration(org.hisp.dhis.scheduling.JobConfiguration)

Aggregations

ImportEnrollmentsTask (org.hisp.dhis.dxf2.events.enrollment.ImportEnrollmentsTask)1 JobConfiguration (org.hisp.dhis.scheduling.JobConfiguration)1