Nope, it's strange that I didn't consider this given that I applied a
similar solution to an earlier problem.

Thanks !

- Danny

On Mon, Aug 19, 2013 at 5:17 PM, Erik Hennum <[email protected]>wrote:

>  Hi, Danny:
>
> Likely you've considered this but ...
>
> One approach would be to manifest the threshhold date (creationDate + 70%
> SLAHours) in the document as well as the target date.  Then, a range query
> can find threshhold dates that are less than the current datetime.
>
>
>  Erik Hennum
>
>   ------------------------------
> *From:* [email protected] [
> [email protected]] on behalf of Danny Sinang [
> [email protected]]
> *Sent:* Monday, August 19, 2013 1:59 PM
> *To:* general
> *Subject:* [MarkLogic Dev General] Custom Constraint that compares values
> of 2 elements
>
>   Hello,
>
>  Is there a way  for custom constraints to compare the values of 2
> elements in the same document ?
>
>  For example, I've got WorkOrder documents that contain the following
> elements :
>
>  1. creationDate
> 2. SLAHours
> 3. targetDate
>
>  targetDate's value is auto-computed as creationDate + SLAHours.
>
>  I'd like to have a custom constraint that would return all workOrder
> documents whose age is X hours away from the targetDate.
>
>  Where :
>
>  1. Age = fn:current-dateTime - creationDate.
>
>  2. X = 30% of SLAHours
>
>  Regards,
> Danny
>
>
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to