• Date and time notification tasks

Document Actions
Replies: 5   Views: 4780
Up one level
You need to be a registered member to post to this forum. Register now.
Prev topic | Next topic

 • Date and time notification tasks

Posted by havoyan at 2004-11-03 13:57
Assume we have 2 parts: Date part which fires event at specified date 0:0 am, and Time part which fires event at specified time. How we can get an event fired at specified date and time.
Manager
Posts: 0

 • Re: Date and time notification tasks

Posted by edwardotis at 2004-11-09 04:01
This only works if these particular Date and Time parts can be guaranteed not to be used by any other parts during the waiting period.

1. Some other part fires INPIN1 for DatePart and TimePart
2. DatePart Outpin1 must connect to TimePart INPIN2
3. TimePart Outpin1 must connect to MyPart Inpin1

DatePart
INPIN1 - setDate ( String newDate )
OUTPIN1 - Boolean alarm

TimePart
INPIN1 - setTime( String newTime )
//setTime will initialize isOn var to false
INPIN2 - isOn( Boolean )
OUTPIN1 - Boolean alarm

MyPart
INPIN1 - isOn( Boolean )
Anonymous
Posts: n/a

 • Re: Date and time notification tasks

Posted by edwardotis at 2004-11-09 04:44
This example makes me wonder if we don't need a cohesive design strategy for parts that should be used by many other parts.

For instance, we could make Date and Time parts for every part that ever needs to run an event at a certain time, but that seems really wasteful.

However, if various parts sent a uniqueID to Date and Time along with their request, then they could all share the same Data and Time parts. Date and Time could just internally keep a vector of requests identified by uniqueID.

However, that would lead to a uniqueID having to be passed around a lot.

In general, I guess this leads to setting up session states within the application to keep track of when everything should be firing. But I know the current parts don't have a mechanism for that.

Or I could be totally off base, and there's a simple solution that I'm overlooking.
Anonymous
Posts: n/a

 • Re: Date and time notification tasks

Posted by bhuynh at 2004-11-09 05:58


After setting the Date and Time the user wanted the application to fire a notification, he/she can fire the application's start inpin. The application's start inpin will fire the start inpin for the DatePart. The DatePart will start counting until it reached the specified Date. When the DatePart reached the sepcified Date, it will fire the TimePart's start inpin. The TimePart will start counting until it hit the specified Time. When this happen, the TimePart will fire a notification that the specified Date and Time is reached.
Anonymous
Posts: n/a

 • Re: Date and time notification tasks

Posted by bhuynh at 2004-11-09 05:59
Anonymous
Posts: n/a

 • Re: Date and time notification tasks

Posted by havoyan at 2004-11-09 07:07
THe diagram is correct. THere is another solution esp. if these parts say dont have start inpin. We can fire the SetTime and SetDate and then have a synchronization part connected to thier outpins. That means when it gets Date event and Time event it will fire its outpin.

Ed, your thoughts are valid for really heavy weight components like database which need to have connection pooling etc. but in case of such simple parts these complexity doesnt make sense. Better to have enough instances of these parts.
Manager
Posts: 0