ScheduletrackingTasksActionFacade

public interface ScheduletrackingTasksActionFacade

Facade used to expose methods as a task actions.

See also: org.motechproject.scheduletracking.domain.Enrollment, org.motechproject.scheduletracking.service.EnrollmentRecord

Methods

enroll

void enroll(String externalId, String scheduleName, String preferredAlertTime, DateTime referenceDate, String referenceTime, DateTime enrolmentDate, String enrollmentTime, String startingMilestoneName)

Creates enrollment from the given parameters and schedules alerts. If the client has already enrolled for the same schedule which is currently active, then we update the existing details and reschedule alerts.

Parameters:
  • externalId – the client external id
  • scheduleName – the schedule name
  • preferredAlertTime – the time of day to send alerts to the client
  • referenceDate – the reference date on which the schedule will start
  • referenceTime – the reference time on which the schedule will start
  • enrolmentDate – the enrollment date on which the client is enrolled into the schedule
  • enrollmentTime – the enrollment time on which the client is enrolled into the schedule
  • startingMilestoneName – the starting milestone name

unenroll

void unenroll(String externalId, String scheduleName)

Unenrolls all enrollments with the given external id and schedule name. Also removes all the scheduled jobs of enrollments.

Parameters:
  • externalId – the client external id
  • scheduleName – the name of the schedule