Re: [concern-users] Handling "business days" in timeouts and other timings
Brought to you by:
hengels,
leonchiver
|
From: Holger E. <he...@me...> - 2005-06-28 16:52:21
|
Quoting Andy Depue <an...@ma...>:
> I would like the ability to specify some of my timeouts in "business days".
me too! our approach at the moment is, that we ignore the timeout (return from
the escalate method without doing anything), if it falls into excluded time.
this is exact as long as the excluded period is at least as long as the
timeout.
my proposal would be to define a calendar interface with a method
long translate(long timestamp, long businessMillis)
.. you pass in the current timestamp and a delay of 3 * 8 * 3600000 (3d). it
will return the same time, but three days later.
This also works, if a delay spans multiple excluded periods.
regards,
Holger
> <activity name="Review Entry"
> class="com.marathon.workflow.concern.MAsynchronousActivity"
> asynchronous="true" user="true" optional="false" timeout="86400">
>
> timeout="86400" represents 24 hours (1 day), but if this activity is started
> at 4:00 PM on Friday, I'd like it to not timeout until 4:00 PM on Monday. If
> started at 4:00 PM on Monday, then it should timeout at 4:00 PM on Tuesday,
> and so on. Has anyone else needed to solve this issue? If so, what was your
> approach? Ideally, it would be neat if I could do something like this:
>
> <activity name="Review Journal Entry"
> class="com.marathon.workflow.concern.MAsynchronousActivity"
> asynchronous="true" user="true" optional="false" timeout="86400"
> time-unit="business-seconds">
>
> For now, I'm taking the approach of using an environment variable:
>
> <activity name="Review Entry"
> class="com.marathon.workflow.concern.MAsynchronousActivity"
> asynchronous="true" user="true" optional="false" timeout="86400">
> <env-enry>
> <env-entry-name>time-unit</env-entry-name>
> <env-entry-type>java.lang.String</entry-entry-type>
> <env-entry-value>business-seconds</entry-entry-value>
> </env-entry>
> </activity>
>
> And then manually adjusting the return value of "getTimeout()" from my
> AsynchronousActivity implementation.
> If this functionality were moved into the Con:cern core, we would probably
> want to use an interface that the end-developer can implement, much like
> Quartz does. Quartz allows you to handle "business" days via this interface:
>
> public interface Calendar {
> public boolean isTimeIncluded(long timeStamp);
> public long getNextIncludedTime(long timeStamp);
> }
>
> You just do this to adjust time:
> long now = System.currentTimeMillis();
> if(!calendar.isTimeIncluded(now + timeout)) {
> return (calendar.getNextIncludedTime(now + timeout) - now);
> } else {
> return timeout;
> }
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> concern-users mailing list
> con...@li...
> https://lists.sourceforge.net/lists/listinfo/concern-users
>
>
|