
admin:group-weekly-scheduled-task( $task-path as xs:string, $task-root as xs:string, $task-period as xs:positiveInteger, $task-days as xs:string+, $task-start-time as xs:time, $task-database as xs:unsignedLong, $task-modules as xs:unsignedLong, $task-user as xs:unsignedLong, $task-host as xs:unsignedLong?, [$task-priority as xs:string?] ) as element(gr:scheduled-task)
This function constructs a task to be invoked at weekly intervals.
      You can call admin:group-add-scheduled-task to add the task.
  
  xquery version "1.0-ml";
  import module namespace admin = "http://marklogic.com/xdmp/admin"
      at "/MarkLogic/admin.xqy";
  let $config := admin:get-configuration()
  return
     admin:group-weekly-scheduled-task(
        "/Scheduler_test.xqy",
        "/Docs",
        2,
        ("Monday", "Wednesday"),
        xs:time("14:42:52"),
        xdmp:database("Documents"),
        xdmp:database("Documents"),
        xdmp:user("Jim"),
        admin:host-get-id($config, xdmp:host-name()),
        "normal")
     (: returns a weekly scheduled task. :)
   
  
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.