Search code examples
marklogic

Task schedule paths


To clean my database, I try to schedule a task. But I wind up in a path spaghetti.

I have a modules database with /src/scheduled/cleanData.sjs
This script contains require("cleanDataLib.xqy"); The scheduled task points to:

  • Task path: /cleanData.sjs
  • Task root: /scheduled
  • Dbase: project-content
  • Modules: project-modules

Now, the SJS script cannot find the cleanDataLib.xqy as stated in the require.

I am clueless as to where the SJS scipt is running from now. The task path? The modules database? The SJS script location?

Running the SJS from the query console works fine, then the XQY is used and no errors appear.

Error from log:

TaskServer: XDMP-MODNOTFOUND: var cleaner = require("cleanDataLib.xqy"); -- Module cleanDataLib.xqy not found

Solution

  • Please change your setting and try again. Task Path = "/scheduled/cleanData.sjs", Task Root="/". I am assuming cleanData.sjs and cleanDataLib.xqy is on the same place '/src/scheduled'