thoughts on the GSoC2009 and OpenMRS summer internship Friday, August 14, 2009

Working on a GSoC project was indeed a wonderful experience. To make it more interesting, working as a summer intern at OpenMRS was value added experience. :) (discarding that fact that SL doesnt have any summers. <:o) ).

Starting the project i had so little experience working with the Quartz scheduling framework. Then again this was my first project from scratch. I had to go through all of the software development phases. Well that was a lovely experience. I had a lot of help from OpenMRS developers to complete my project. All helped to test the module and give feedback. without those comments the current schedulerQuartz module wouldn't have come this far. i was lucky enough to have my own Lab machine which helped a lot to test the module and to do Demos.

Justin Miranda, being my mentor was a great benefit to this project. I can remember the hours he spent advising me on how to improve usability. His supervision made the module to have good unique features. I must say that i didnt have any kind of pressure from him while doing this project. (of course we only had less than 3 months to complete it and get it running). you rock!

looking back, OpenMRS is a great place for anyone to do their summer internship for Google Summer of code project. Developers working at OpenMRS knows how to identify your capabilities and only to take what you can give. It has a friendly environment so that a new comer would feel comfortable enough to give his full effort in making a project success.

I would like to thank Justin for supervising my project. And everyone at OpenMRS for helping me to bring the schedulerQuartz to where it is right now.

schedulerQuartz v0.2.0 user guide

QuartzScheduler v0.2.0 User Guide

Table of Contents
1 About QuartzScheduler

2 Module Settings.

3 Using the module

3.1 Module Sections.

3.1.1 Scheduler Manager
3.1.2 Scheduler Details

3.1.3 Scheduler Log

4 Creating a new Task

5 Get details of a created Task and modifying


1 About QuartzScheduler

The quartzScheduler module was create as a Google Summer of Code 2009 Project. It’s a scheduler created to give extensive scheduling features to OpenMRS users. The quartzScheduler uses OpenMRSs core schedulers Task classes to schedule its tasks.

Additional information can be acquired emailing the module creator djmlog103[-at-]gmail.com or contacting the developer list dev[-at-]openmrs.org
2 Module Settings
The quartzScheduler module needs a set of parameters to be passed before users start using the module. These set of parameters of parameters are used to setup mail configurations in order for the module to use its email notifications features. You should save the following set of key,value pairs in your OPENMRS_RUNTIME_PROPERTIES.PROPERTIES file. Please note that the module notification service users only stmp transmission.

Eg:
schedulerquartz.smtphost=smtp.orgmail.com
schedulerquartz.smtpport=465

schedulerquartz.smtpdebug=false
schedulerquartz.smtpusername=yourOrganization@email.com

schedulerquartz.smtppassword=password

schedulerquartz.serverhost=www.organization.org/openmrs


3 Using the module
After loading the quartzScheduler module, a new category named Quartz Scheduler will appear in the Administration section.





Figure 1: Loaded Module


3.1 Module Sections

  • Scheduler Manager : Create, Edit, Delete Tasks.
  • Scheduler Details : Shows information about the Quartz Scheduler.
  • Scheduler Log : A detailed module level log.

3.1.1 Scheduler Manager

This section allows users to Create new Tasks, Edit and Delete existing tasks.











Figure 2: Scheduler Manager page
3.1.2 Scheduler Details
The SchedulerQuartz scheduling module is created using Quartz scheduling Framework. This Section Allows you to see on what configurations the Quartz Scheduler is running on.











Figure 3: Scheduler Details page
3.1.3 Scheduler Log
This section is intended for Task developers. This page contains all the log data produced in the module scope. The Scheduler log page is equipped with a tailing feature which would print latest lines of the log file in the given iteration time. To improve usability the module log is printed in reverse order to avoid scrolling. This means that all the current data from the log will be printed on top of the page.











Figure 4: Scheduler Log page
4 Creating a new Task
Creating a new task is quite simple. Go to the Scheduler Manager page. Click on the Create Task button.




Figure 5: Create a new Task

Clicking Create Task will bring a popup window which allows users to create new Tasks. Creating a new Task in the SchedulerQuartz Modules is so simplified that there is nothing to explain in this guide. A detailed explanation about creating tasks is given in the Create Task page.












Figure 6: Create Task page


5 Get details of a created Task and modifying

To get Additional information of a created task, visit the Scheduler manager page. And click on the Tasks title on which you to view additional information.










Figure 7: click to get additional information

Click on the Tasks title will bring a popup window with a detailed page of that Task. To modify the Task just click the “Edit Task” link show in figure 8.












Figure 8: Detailed info on a Task


Created on: 8/13/09
Author: djmlog103

Last week of google summer of code (2009)

It has come to the last few days of GSoC2009. I couldnt keep up with blogging my work in the past weeks. Here's a list which consist of my weekly progress. (extracted from projects tracking document)

Iteration #1 (Sunday, May 31, 2009)

  • Created new basic module for quartz scheduler
  • Committed quartzscheduler module to the svn repository
  • Made module deployable in OpenMRS 1.5
  • Integrated code and configuration that has already been written into the new module
  • Allow user to schedule a simple hello world task to write a message to the log on some interval

Iteration #2 (Sunday June 7, 2009)

  • Got to know more on how quartz work and its post-schedule(what options does it have after scheduling a job) features.
  • User stories 35-38 (Edit/new Task page)
    • 35. Allow users to enter the task name of the class.
      36. Allow users to enter the description of the schedule.
      37. Allow users to set the priority of the schedule.
      38. Allow users to set the recurrence option for the schedule
      a) Run Once
      b) Seconds
      c) Minutes
      d) Hours
      e) Daily
      f) Weekly
      g) Monthly
      h) Yearly
      i) Cron

Iteration #3 (Sunday June 14, 2009)

  • User stories 8-14 (scheduler Manager page)
    • 8. Allow users to view class name of the class being scheduled.
      a. Allow users to click on the class name and view a full description of it.
      9. Allow users to view the owner of a particular schedule.
      10. Allow users to view the date of which a particular schedule is created.
      11. Allow users to view the date of which a particular schedule is be stopped running.
      12. Allow users to view the priority of a particular schedule.
      13. Allow users to view the status of a particular schedule.
      a. Started
      b. Stopped
      c. Finished
      d. Failed
      14. Allow users to view the next occurrence time of which the scheduler will start executing.
  • User stories (view Task page )
    • 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.
  • Added more strict validations to the scheduler Form page

Iteration #4 (due Sunday June 21, 2009)

completed implementation of the following pages:
  • Scheduler Manager Page
  • View Task Page
  • Create Task Page
  • QA test on the Create Task page (Bugs Found):
    • RunOnce
    • Seconds
      • when selected the repeat option it always executes one more time than what i put.
    • Minutes
      • Doesnt execute on the given end time. the schedule finished before it.
      • when selected the repeat option it always executes one more time than what i put.
    • Hours
      • when selected the repeat option it always executes one more time than what i put.
  • Implement user stories 15-17
    • Allow users to execute a particular task immediately.
      Allow users to skip the next occurrence of a task from being executed.
      Allow users to delete a particular schedule.
  • Finalize feature list of the 3 pages with Justin.
  • Finish the View Task page completely.
  • Try to integrate openMRS Jobs, replacing the hello world dummy job.
  • Deploy quartz scheduler module to labs

Iteration #5 (due Sunday June 28, 2009)

  • Scheduler Types QA

Iteration #6 (due Sunday July 5, 2009)

  • Fixed scheduling bugs in the TabsForm page.
  • 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 click on the class name and view a full description of it (scheduler manager page).
  • Allow user to view a particular schedules list of execution dates
  • Allow user to view number of jobs in the Scheduler.
  • Allow user to view number of jobs by status (started, finished, failed, stopped).

Iteration #7 (due Sunday July 12, 2009)

  • Followed up with some R&D on how to edit quartz JobDataMap on the fly.
  • Fixed remaining bugs.

Iteration #8 (due Sunday July 19, 2009)

  • Changed DumbJob to TaskWrapper
  • view_tasks.jsp renamed to taskList.jsp
  • tabForms.jsp renamed to taskForm.jsp
  • Added the drop down list. other changes will follow after a UAT
  • Schedule List on the View Task page should be "Next 10 execution times"
  • Added Light Green and red. Green shows started tasks. Red shows paused/stopped tasks
  • The "Run Now" and "Delete" buttons should be on opposite sides. In addition, the "delete" button should be smaller (the "trash" icon) or should be a checkbox, with a Delete Selected button under the table (or in the table footer).
  • Added server time to the create task page.
  • Removed priority from the Create Task and leave that as a detail for the Edit Task page.
  • The Scheduler Manage page should also show the current time so users can compare the current time against all of the tasks that are in the system.
  • Added the scheduler logger page with tailing functionality.
  • Added the base to send notification mail
  • Added the edit task functionality.

Iteration #9 (due Sunday July 26, 2009)

  • Added Notification sending features
  • Added properties functionality
  • minor UI changes

Iteration #10 (due Sunday Aug 2, 2009)

  • added the notification Title after the UI change
  • UI changes (new functionality should stop at this stage)

Iteration #11 (due Sunday Aug 9, 2009)

  • UI
    Renamed Scheduler Manager to Task Manager
    Renamed Scheduler Summary to Scheduler Manager
    ===== Scheduler Manager===========
    Added some spacing between the scheduler Manager buttons
    Added tooltips to Restart/Pause/Resume buttons saying what itll do.

    ===== Scheduler Log ===========
    • Changed "Tail Every" to be "Refresh every" with option (Never, 10 seconds, 30 seconds, 60 seconds)
    • Changed "Get Log Now!" to "Refresh Now"
    • added < style="overflow: auto; height:400px"> ... < /div > around the logging contents so the user sees the whole page and only the logging content is scrollable.


    ===== Task Form ===========
    • 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] [08/04/2009 ][cal]

    • 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] [08/04/2009 ][cal]

    • Changed "Repeat infinite times" to "Repeat forever"

    Funtionality
    • Added the Edit QuartzTask method
    • mail fix (receive only once)
    • Surrounded the pause/start scheduler with a box
    • Number of lines displayed message in the scheduler log
    • Fixed the Email URL

Iteration #12 (due Sunday Aug 16, 2009)

  • 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 (x) was made consistent in the create task page.
  • made the module user guide.
  • blog and project page update.

GSoC2009 - Quartz Module Updates Wednesday, June 17, 2009

There are some significant progress on the scheduler module last week.


I was able to:
  • Was able to introduce the scheduler manager page in to the module.
  • Got its back and completed (deleting schedules, Executing it now, Stop/resume features).
  • Got the View Task page running without any errors.
  • modified how date/time is shown in the view Task and manager page.
  • Fine tuned the scheduling mechanism.
  • Did some QA tests on the scheduling.
Things i couldnt get done:
  • Integrate the test cases i developed.
  • Integrate the current scheduleing service to the quartz module. (most probably we wont)
Things to do this week:
  • Should finish testing the Edit/New Task page (QA test)
  • Finalize feature list of the 3 pages with Justin.
  • Finish the View Task page completely.
  • Try to integrate openMRS Jobs, replacing the hello world dummy job.
  • Deploy quartz scheduler module to labs
  • Try to implement the following user stories
  • Allow users to delete a particuler schedule
  • Allow users to stop/resumes schedules
  • Allow users to execute a task instantly

Nasty Nephews :) Saturday, June 6, 2009

People may think that its so cool to become an uncle at a early stage of life. Well it kind of is. But you may get second thoughts once in a while. My nephew is almost 9 now. And im sure anyone would go nuts if they spend just a day with him. He comes to visit me once in awhile and boy... its havoc that day at home. He will run all over the house, Will dirt all the walls by trying to do "Spiderman" (its fun to watch though). He spends a lot of time showing his "muscles" to impress everyone. And guess what? im his hero (awesome). hehehehe.

He has caught the habit of playing video games at an early stage (thanks to his heroic uncle. :P ). There are like 50kinds of games he would play almost any day he would visit me. Funny how that happens cuz he comes running after me saying "uncle.. uncle.. i want to play a video game". And i find some online flash game site and loads somewhat easy game to play. ok here's how the 50 game thing works. he "tries" to play the game for 5mins and starts saying "This ones no good. Its not that i cant play it. but its boring. Please put me another game uncle...". Then i spend another 15mins trying to find a game he could possibly play. And thats a for loop which iterates infinitely until his mom comes and take him home. :D. I found out that the exception occurs in the for loop after 50 or so iterations.

But really Its fun to have a brat running around doing funny, annoying things which i used to do when i was at his age. :)

GSoC2009 - Quartz Module Updates Friday, June 5, 2009

It has been a tough week i can tell you. Finding my way through OpenMRS modules took some late hours from my day, but i think i can safely say that the storm is passing. I was able to successfully integrated quartz to a module.

Things ive been doing the past week:

  • Integrated Quartz sql script to the sqldiff.xml.
  • Initialized Quartz scheduler on module startup and stopped it on shutdown.
  • Created a Form, Controller with validators for users to create schedules.
  • Successfully developed and integrated scheduling mechanism for RunOnce, Seconds, Hours, Daily to the module.
Although ive not discussed this weeks tasks list with justin. Im hoping to:
  • integrate test cases for the Quartz service which ive done in a separate webapp.
  • refactor the current implementation to work with the existing scheduler service and TaskDefinition.
  • Fine tune the scheduling mechanism.
  • Do some thorough testing through running the module.
I feel like im not updating the blog regularly. Feel a bit guilty about that but those arent without reasons too. Ill probably have to put more attention in documenting what im doing.

possible road blocks i may face:
  • My music playlist running out while working on openmrs.
  • Figuring out how to write test cases in openmrs modules.
  • Getting form details persisted inside quartz tables and retrieving them back.

Quartz Module - meeting minutes 5/28/2009 Wednesday, May 27, 2009

The project kickoff meeting was held today. Justin and I agreed to follow the following iterations. Iteration end point was set to 30th(Sunday) May.

  • Create new basic module for quartz scheduler
  • Commit quartzscheduler module to the svn repository
  • Make module deployable in OpenMRS 1.5
  • Integrate code and configuration that has already been written into the new module
  • Allow user to schedule a simple hello world task to write a message to the log on some interval
Looks kind of simple for the moment. But lets see where this take us.

These iterations will be based on the initial mockups and the project proposal i submitted before starting the project.
The proposed mockups and initial project plan is available here:
http://djmlog103.googlepages.com/Quartz_Scheduler_MockupsDilupa_Munin.pdf
http://djmlog103.googlepages.com/Quartz_Scheduler_ProposalDilupa_Muni.pdf

Minor UI changes will be made to the create/edit Task page which i will post here shortly.