0

I have one requirement while running DHF flow I can't use cts.uris in place of sourceQuery. I want to use some script. How can I achieve this?

I tried like this.. but not working

I have placed my script under a custom directory and calling that script in the flow. If I run sourceQuery in qconsole it was working, but if I try to run the flow I'm getting an error.

(Logging HTTP response body to assist with debugging: {"errorResponse":{"statusCode":400, "status":"Bad Request", "messageCode":"RESTAPI-INVALIDREQ", "message":"RESTAPI-INVALIDREQ: fn.error(null, 'RESTAPI-INVALIDREQ', err); --Invalid request:)

I tried like this, but it's not working

"sourceQuery" : "require('/custom-modules/custom/my-source-query.xqy').sourceQuery()",
"sourceQueryIsScript" : true,
Mads Hansen
  • 63,927
  • 12
  • 112
  • 147

1 Answers1

0

Documentation indicates that field sourceQuery must be "Set sourceQuery to a string containing any script that can be passed to xdmp.eval"

https://docs.marklogic.com/datahub/5.4/flows/customizing-steps.html

  • Hi Andres, I tried by changing xqy script to sjs script still it's not working "sourceQueryIsScript" : true, "sourceQuery" : "require('/custom-modules/custom/myQuery.sjs').instance(1000)", but if i run souceQuery in qconsole i was able to get uris – Jyothi M S Feb 19 '23 at 09:07