Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Other JSE/JEE APIs and the fly likes Auto mail trigerring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Auto mail trigerring" Watch "Auto mail trigerring" New topic
Author

Auto mail trigerring

Avinash Chaturvedi
Greenhorn

Joined: Jul 21, 2010
Posts: 6
Hi all,
I am developing a leave application system & i want to have a functionality that if an employee applies for a leave & his leave is not approved by his reporting manager within 3 days of the application date then an automatic approval should be generated & a mail should be send parallely to the employee who has applied for the leave & also to the reporting manager & duration of 3 days should not include saturday's,sunday's & national holidays.Please send me some replies which can solve this issue.


ANURAG CHATURVEDI.
BANGALORE(INDIA).
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What's the actual question? How to send mail? How to check the database for dates three days in the past to determine who gets emails?
Avinash Chaturvedi
Greenhorn

Joined: Jul 21, 2010
Posts: 6
the actual question is:


if I am the employee & I am applying for a leave say for example I post my application on 22/07/2010,for a leave of 7days from dates 02/08/2010 till 08/08/2010,

1. at the time of application it should check the calendar & display that 07/08/2010 & 08/08/2010 are saturday & sunday,so can't apply for leave on these days.

2. as I have applied on 22/07/2010 & my reporting manager dosen't responds to it in next three working days,then by default it should calculate the next three working days i.e. by 27/08/2010, the application should be approved by not counting the Saturday & Sunday i.e. 24 & 25 july & approve the leave on 27/08/2010 early morning & a mail should be triggered parallely to the applicant as well as the reporting manager.

Please reply.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

So... search for leaves not approved > 3 days that haven't had emails sent and send the emails to the appropriate people.

Again--what's the actual question? I *know* the problem statement: I don't know what you don't know how to do.
Avinash Chaturvedi
Greenhorn

Joined: Jul 21, 2010
Posts: 6
actually we don't know how to make the process of mail triggerring,we will sort the leaves which have not been approved from the last 3 days

1. In the last three days how to exclude the Saturday's & Sunday's for the calculation,how to apply that logic.

2. How to trigger the mail after sorting the unapproved leaves.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Run a daily job to sweep the database looking for appropriate dates.

You know how to find what day it is, you know how to decide if weekends come into play, I would assume you have a way of knowing what holidays you have to pay attention to: given all that, can you think of a way to decide what date you need to check for?
Avinash Chaturvedi
Greenhorn

Joined: Jul 21, 2010
Posts: 6
the main problem is:

We don't know how to calculate the weekends & national holidays in the duration of the leave applied for

&

How to match the calender for excluding weekends for auto approval scheduling of mails.

How to do it from front-end in java class the scheduling of validation & auto-approval mails.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60732
    
  65

Nothing to do with Servlets. Moved to a more appropriate location.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Avinash Chaturvedi
Greenhorn

Joined: Jul 21, 2010
Posts: 6
Suggest us on what shall we move-on to other than servlets.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

(It's already been moved.)
Avinash Chaturvedi
Greenhorn

Joined: Jul 21, 2010
Posts: 6
We can't understand what you mean to say.Please guide us.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Auto mail trigerring
 
Similar Threads
reminder generation
problem with rollback()
leave letters - hilarious
Only fun forwards for fun ...
problem of rollback()