Ah, true.. complicated..

I would normally say: use xdmp:get-request-path() to single out the schedule 
details you are looking for. But I am pretty sure that will return an empty 
string, since a scheduled task is not triggered by a (http) request. Provided 
the path to the xqy is sufficiently unique anyhow..

You could also add that path as a variable inside the xqy itself. But I would 
be the first to admit that it is not the most elegant solution. Might just do 
the trick for you, though..

Kind regards,
Geert

-----Oorspronkelijk bericht-----
Van: [email protected] [mailto:[email protected]] 
Verzonden: donderdag 10 februari 2011 14:59
Aan: Geert Josten
Onderwerp: RE: [MarkLogic Dev General] how to get scheduled info like 'time' to 
the 'scheduled xquery file'

Hi,

Actually i,ve many tasks which are being scheduled. If i use the function 
'admin:group-get-scheduled-tasks', i'll get all the scheduled task list. I need 
to get the info of the task which is triggered at that particular point of time.

Thanks & Regards
Sujan Reddy A
-----Original Message-----
From: Geert Josten
Sent:  10/02/2011 7:22:37 pm
Subject:  RE: [MarkLogic Dev General] how to get scheduled info like 'time' to 
the 'scheduled xquery file'

Hi Sujan,

In that case you will need the admin:group-get-scheduled-tasks function 
(http://developer.marklogic.com/pubs/4.2/apidocs/AdminLibraryScheduler.html#admin:group-get-scheduled-tasks),
 it returns all schedule details as xml. I expect the executing user will need 
sufficient privileges for this.

Unfortunately, I am not aware of an xdmp function to retrieve this info. I know 
that xdmp:host-status returns the server-id of the task server, so you could 
use that to call xdmp:server-status, but to my knowledge such schedule details 
cannot be found in there.

Kind regards,
Geert

-----Oorspronkelijk bericht-----
Van: [email protected] 
[mailto:[email protected]] Namens [email protected]
Verzonden: donderdag 10 februari 2011 14:40
Aan: General MarkLogic Developer Discussion
Onderwerp: Re: [MarkLogic Dev General] how to get scheduled info like 'time' to 
the 'scheduled xquery file'

Hi,

I need to get the scheduled details...

Thanks & Regards
Sujan Reddy A
-----Original Message-----
From: Geert Josten
Sent:  10/02/2011 6:31:24 pm
Subject:  Re: [MarkLogic Dev General] how to get scheduled info like 'time' to 
the 'scheduled xquery file'

Hi,

It sounds like you want to now the current time at execution. You can get the 
current date/time using fn:current-date/fn:current-dateTime/fn:current-time. 
You could also try to retrieve the schedule details, but this is easiest I 
guess..

Kind regards,
Geert

Van: [email protected] 
[mailto:[email protected]] Namens Sujan Reddy
Verzonden: donderdag 10 februari 2011 13:44
Aan: [email protected]
Onderwerp: [MarkLogic Dev General] how to get scheduled info like 'time' to the 
'scheduled xquery file'

Hi,

i need to get the 'scheduled info- like time' to the scheduled xquery file.

    admin:group-one-time-scheduled-task(
        "/Scheduler_test.xqy",
        "/Docs",
        xs:dateTime("2011-03-29T14:42:52"),
        xdmp:database("Documents"),
        xdmp:database("Documents"),
        xdmp:user("Jim"),
    admin:host-get-id($config, xdmp:host-name()))

For the above code, the scheduled xquery ie., 'Scheduler_test.xqy'  will start 
executing at the given particular time.
Please let me know if there is any api or method to get the scheduled time in 
that xquery (Scheduler_test.xqy)


Thanks & Regards
Sujan Reddy

_______________________________________________
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