...
Table of Contents | ||||||||
---|---|---|---|---|---|---|---|---|
|
</div>
Overview
There are many activities within a healthcare information system which benefit from automation. For example: daily clinic reports might need to be generated the morning before a clinic opening, decision support rules might need to be run over a patient group once every week, or healthcare data coming in from outside sources might need to be analyzed every 30 mins. To give end implementations the flexibility to define these sorts of automated conveniences, the OpenMRS community has added scheduler functionality to the core software application. The OpenMRS scheduler (based on the JDK Timer) currently supports executing tasks on regular basis (i.e. a task will execute every X seconds, minutes, hours, days). However, there's no way to schedule a task to recur at a particular time every week. The data model supports this type of feature (start time and repeat interval), but we need to add some logic to the Scheduler to handle triggering these tasks to occur at exact times.
We want to support more complex scheduling (i.e. cron-like) in the very near future, where we can specify rules that will allow Tasks to run more more/less frequently based on the day/time. For instance, an implementation might want to schedule a Task to run once every day at midnight, but also at 6pm on Saturday and Sunday. This type of scheduling would be difficult to support using the JDK Timer, so we would like to add an extension point to the scheduler to allow a developer (probably myself) to create a module based on the Quartz Scheduler. This will allow us to handle more advanced scheduling requirements.
Requirements
High-Level Specification
These are some of the high level specifications and user stories that could be included in this project. During the design phase, we will add even features and requirements. After creating the full backlog of features, the team will meet with users/stakeholders to prioritize all features in order to figure out which ones are going to be implemented in a first release.
- Discuss synchronization/threading issues that we've had to deal with in the current scheduler implementation.
- Decide whether to build as a module to extend current functionality or as a core component to replace the current functionality.
- Decide whether to include quartz tables in the openmrs schema or within a separate schema.
- Implement a Quartz version of the scheduler to extend (possibly replace) the current JDK Timer implementation.
- Implement advanced task scheduling (with Quartz cron triggers).
- Implement simple task scheduling (with Quartz simple triggers).
- Migrate existing scheduled tasks to use new simple task scheduling (if time permits).
- Allow users to create, retrieve, update, and delete tasks.
- Allow users to schedule tasks to be run on an interval (i.e. every 30 seconds) or at specific moments in time (Tue, March 24 at 10:42pm).
- Allow users to start and stop tasks.
- Allow users to schedule emails to be sent at a specific time.
- Allow users to schedule reports to be generated and sent to stakeholders at a specific time.
- Create unit tests for each expected behavior of every method within the scheduler service and its domain objects.
- Redesign the Manage Scheduler user interface (if time permits).
User Stories
1.Must Have
- Allow user to create a new task.
- Allow user to view the details of a particular schedule.
- Allow user to delete a particular schedule.
- Allow user to start a particular schedule.
- Allow user to stop a particular schedule from running.
- Allow user to execute scheduling combinations.
- Allow user to schedule a task to run only once on 6/23/2009 11:52PM (Tested)
- Allow user to schedule a task which would run every 5 seconds on 6/23/2009 11:52PM infinitely (Tested)
- Allow user to schedule a task which would run every 5 seconds on 6/23/2009 11:52PM for only 10 times.(Tested)
- Allow user to schedule a task which would run every 5 seconds on 6/23/2009 11:52PM until 6/24/2009 12:45AM.(Tested)
- Allow user to schedule a task which would run every 7 Minutes on 6/24/2009 11:53PM infinitely (Tested)
- Allow user to schedule a task which would run every 2 Minutes on 6/23/2009 11:51PM for only 9 times.(Tested)
- Allow user to schedule a task which would run every 3 Minutes on 6/24/2009 11:53PM until 6/24/2009 12:46AM.(Tested)
- Allow user to schedule a task which would run every 1 Hours on 6/24/2009 11:53PM infinitely (Tested)
- Allow user to schedule a task which would run every 1 Hours on 6/23/2009 11:51PM for only 9 times.(Tested)
- Allow user to schedule a task which would run every 1 Hours on 6/24/2009 11:53PM until 6/25/2009 12:54AM.(Tested)
- Allow user to schedule a task which would run every 2 Days on 6/24/2009 11:53PM infinitely (Tested)
- Allow user to schedule a task which would run every 2 Days on 6/23/2009 11:51PM for only 9 times.(Tested)
- Allow user to schedule a task which would run every 1 Days on 6/24/2009 11:53PM until 6/27/2009 12:54AM.(Tested)
- Allow user to schedule a task which would run Every Weekday Infinitely (Tested)
- Allow user to schedule a task which would run Every Weekday But end on 6/27/2009 12:54AM.(Tested)
- Allow user to schedule a task which would execute on a selected day of the week or several days of a week and would run for infinite number of times.(Tested)
- Allow user to schedule a task which would execute on a selected day of the week or several days of a week and would run until a given end date.(Tested)
- Allow user to schedule a task which would execute once every 2 months and repeat only 2 times.(Tested)
- Allow user to schedule a task which would execute once every 2 months for infinite number of times.(Tested)
- Allow user to schedule a task which would execute once every 2 months and it to end on a given end date/time.(Tested)
- Allow user to schedule a task which would run on the first Sunday of every month infinitely.(Tested)
- Allow user to schedule a task which would run on the last Monday of every month infinitely.(Tested)
- Allow user to schedule a task which would run on the second Wednesday of every month and end on a given date and time(Tested)
- Allow user to schedule a task which would run on the third Tuesday of every month and end on a given date and time.(Tested)
- Allow user to schedule a task which would run on 21st of January every year infinitely.(Tested)
- Allow user to schedule a task which would run on 21st of January every year and end on a given date/time.(Tested)
- Allow user to schedule a task which would run on the first Sunday of every March infinitely.(Tested)
- Allow user to schedule a task which would run on the last Monday of every September infinitely.(Tested)
- Allow user to schedule a task which would run on the second Wednesday of every June and end on a given date and time(Tested)
- Allow user to schedule a task which would run on the third Tuesday of every December and end on a given date and time.(Tested)
- Allow user to schedule a task which would execute to a given Cron string.(Tested)
- Allow user to schedule a task to run once every 3 minutes (or every 30 seconds or every 10 hours or every 1 days).
- Allow user to schedule a task to run every 2 weeks on Mondays.
- Allow user to schedule a task to run on the 1st day of every month.
- Allow user to schedule a task to run on the 2nd Monday of the month.
- Allow user to schedule a task to run once every day at 6pm.
- Allow user to run a single task (class) on several different schedules.
- Allow user to execute a particular task immediately.
- Allow user to view the status of a particular schedule (Started, Stopped, Finished, Failed).
- Allow user to view the next occurrence time of which the scheduler will start executing.
- Allow user to view the date of which a particular schedule is being stopped running.
- Allow user to view the status of a particular schedule.
- Allow user to view the description of the status of a particular schedule.
- Allow user to set the priority of the schedule.
- Allow user to set the recurrence option for the schedule (Run Once, Seconds, Minutes, Hours, Daily, Weekly, Monthly, Yearly, Cron)�
- Allow user to restart the scheduler.
- Allow user to Pause all schedules in the scheduler.
- Allow user to resume all paused schedules.
- Allow user to view a particular tasks, number of remaining executions.
- Allow user to view a particular schedules list of execution dates
...
- Allow user to view log file from the scheduler manager
- Allow user to view scheduler specific log messages from the Manage Scheduler page
- Allow user to view task specific log messages from the
- Allow user to subscribe and receive email notifications on task lifecycle events (start, each execution, end, error)
- Allow user to specify "properties" that the task can use during it's execution
- Allow user to select a Task subclass from a drop down (should include all Task subclasses from core and modules)
- Allow user to edit task definitions (which task to run).
- Allow user to update the schedule for an existing Task.
- Allow user to duplicate an existing task definition (task + schedule)
- Allow user to choose class from a drop down list.
Panel Allow user to display the schedule list according to a time period of his choice (Day, Week, Month, Year) *
- Allow user to receive an email alert before a particular schedule starts for the first time.
- Allow user to receive emails when a particular schedule failed executing.
- Allow user to view the number of times a particular schedule should execute.
- Allow user to view the number of times which a particular schedule has executed.
- Allow user to view the scheduler Summary
Project Plan
Iteration 1 (Sunday, May 31, 2009)
...
- UI
- Renamed Scheduler Manager to Task ManagerRenamed Scheduler Summary to Scheduler Manager
Scheduler Managerh4. =
- Added some spacing between the scheduler Manager buttonsAdded tooltips to Restart/Pause/Resume buttons saying what itll do.
...
- Made the dialog box a little wider and taller. Maybe 750 x 550.
- For the "Often" radio button, add "Every" above the options (like this) Every ( ) ____ _ seconds ( ) __ ___ minutes ( ) _ ___ _ hours ( ) _ ____ days ( ) weekday (Monday, Tuesday, Wednesday, Thursday, Friday)
- Changed the "Start Date" / "Run Time" to be a single line (like "End at") Start at 01 00 00 AM archive:08-04-2009cal
- Moved the server time to the "When do you want to start?" section When do you want to start? ------------------------------------------------- The current time on the server is: 01:34:59 PM Start at 01 00 00 AM archive:08-04-2009cal
- Changed "Repeat infinite times" to "Repeat forever"
...
- Tooltips made more consistent.
- resuming a task would work only if the scheduler is in running state
- Added sorting by title to the scheduler manager datagrid.
- close button was made consistent in the create task page.
- made the module user guide.
- blog and project page update.
Mockups
Application
Student Checklist
- The candidate will complete the following tasks (at a minimum):
- ... write a proposal that includes a realistic project plan.
- ... complete the OpenMRS Application Template.
- ... submit their application for review to the Google Summer of Code site.
- The candidate possesses:
- ... some/all of the skills required for this project (Java, Hibernate, Spring, Quartz).
- ... a good understanding of the project – ask good questions, write a proposal that speaks to me.
- ... an understanding of the existing system and its limitations.
- ... the skills to write a project plan that is realistic and well planned.
- ... the ability to learn quickly.
- ... enthusiasm for the project.
- ... a willingness to learn.
- ... a willingness to contribute before/after Google Summer of Code.
- ... a willingness to maintain the project (source code, documentation) after the Google Summer of Code.
- ... a willingness to communicate with their mentor and other OpenMRS developers.
- ... a willingness to communicate with users / implementers (the broader OpenMRS community).
- ... a good sense of humor.
- The candidate likes:
- ... to take long walks on the beach.
- ... to talk ... or not talk ... for hours.
- ... snow peas.
FAQs
If you are a student with a question, please add your question to the list below and email Justin Miranda. I will respond as soon as I can.
...
Panel |
---|
Question 9: What is the Data Store that should be used? In Order to maintain the state we have to use a JDBC Database. In that case there are about 12 tables that need to be created within OpenMRS Database. How to handle this? Is it ok if this much number of tables to be added into the OpenMRS Database for scheduling? |
Resources
Project Documents
- Project Discussion (has not been created yet)
- Release Backlog (has not been created yet)
- Iteration Backlog (has not been created yet)
OpenMRS Documents
- Scheduler API
- Quartz Scheduler Developer's Guide
- Quartz Scheduler User Guide
- Technical Discussion about existing Scheduler
Blogs
External
- For more information on Quartz, please see the Quartz Project home page.
- more resources to follow
Panel </body></html>