<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
-------- Original Message --------<br>
<br>
Dear Mark,<br>
<br>
Thanks again for your tasty BOF at Javapolis07, it was a pleasure
meeting you.<br>
<br>
As you suggested me to post it, here is the feature request we talked
about:<br>
<br>
Our company often has to code time spans across working hours for
ticketing systems (issue tracking/service calls) in accordance with
ever-changing SLA (service level agreements). Those times calculi are
PAINFUL in an imperative language. <br>
<br>
Therefore I wish I could have a modification of the 'duration'
principle that would allow the coding of such rules:<br>
<br>
When <br>
a customer ticket is opened for more than two hours during
working_hours_2008<br>
and state is urgent<br>
then<br>
send a reminder to the support team and the team leader<br>
-<br>
When <br>
a customer ticket is opened for more than four hours during
working_hours_2008<br>
and state is urgent<br>
and no action taken<br>
then<br>
escalate ticket<br>
<br>
This might require:<br>
* A scheduling mechanism such as quartz (sort of java combination of
'at' and 'cron' Unix commands with extension capabilities) to trigger
the second assertion of the LHS at a specific time.<br>
* New syntax tokens: during, "for"<br>
* New nonterminal symbols after these tokens (composite date and time
classes)<br>
<br>
I have since then had a talk with Stephen Colebourne at Javapolis; he
is the responsible of the JSR 310 Date and Time API
(<a class="moz-txt-link-freetext" href="http://jsr-310.dev.java.net">http://jsr-310.dev.java.net</a>). <br>
<br>
I have proposed him to extend the scope of the JSR to accept composites
of DatesWithoutTime and TimeIntervals objects to enable the retrieval
of a OffsetDateTime by calculating the span of a Duration trough a
CompositeDateAndTimeInterval. <br>
<br>
An example is much more clear:<br>
CompositeTimeInterval working_hours = EnhancedTimeInterval(Mon tru fri
8:00 to 20:00)<br>
TimeInterval lunchbreak = 12:00 to 12:45<br>
CompositeDateWithoutTime belgiumBankHolidays2008 = 1 Jan 2008, 23 Mar
2008, 24 Mar 2008, 1 May 2008, 11 May 2008, 12 May 2008, 21 Jul 2008,
15 Aug 2008, 1 Nov 2008, 11 Nov 2008, 25 Dec 2008<br>
CompositeDateWithoutTime specialOpeningDays = Sun 20 Feb (launch of our
new super awaited product), Sun 21 Dec (shopping day before Xmas)<br>
CompositeTimeInterval working_hours_2008 = new CompositeTimeInterval()<br>
working_hours_2008.include(working_hours)<br>
working_hours_2008.exclude(lunchbreak)<br>
working_hours_2008.exclude(belgiumBankHolidays2008)<br>
working_hours_2008.include(specialOpeningDays)<br>
<br>
This composite is to be used after the 'during' token. The duration
would require its own syntax token (the word 'for' is already overused
in programming languages, it could lead to confusion)<br>
<br>
These composites would have to be defined somewhere at sometime for the
BRE to access them. Could they be directly defined in rule packages? Or
accessed as <br>
<br>
Thus, in order:<br>
* assert LHS's CEs<br>
* calculate the time span of the duration across the 'agenda' (also a
confusing keyword, would it be good English to call it schedule?)<br>
* set an event in the future for the matched object<br>
* when it’s event time: callback the object LHS assertion<br>
* and if still true, execute RHS<br>
<br>
I would be very happy to contribute to the implementation of this
feature, please let me know if you (and your team) are interested in
such a feature.<br>
<br>
Looking forward to hearing from you,<br>
<br>
Stanislas Herman Rusinsky.
<br>
<font color="gray" size="2"> </font>
</body>
</html>