如何构造这个XQuery以在CORB作业中运行?使用匹配的候选URI处理每个文档的第二个模块不起作用。
URIS模块
(:a module to select the candidate URIs to process:)
xquery version "1.0-ml";
declare variable $target-collection := "/activity";
declare variable $update-collection := "/activity/analytics-read-added"
let $uris := cts:uris( (),
(),
cts:and-query((
cts:collection-query($target-collection),
cts:not-query(cts:collection-query($update-collection))
))
)
return (count($uris), $uris)工艺模块
(:a module to process each doc with a matching candidate URI:)
declare variable $URI as xs:string external;
xdmp:document-add-permission($URI,xdmp:permission("act-read-role","read")),
xdmp:document-add-collections($URI,$update-collection)发布于 2017-08-09 00:25:44
您的流程模块有几个小问题:
$update-collection,也需要在Process中声明它。xdmp:document-add-permissions()将这些更改应用于流程模块:
xquery version "1.0-ml";
(:a module to process each doc with a matching candidate URI:)
declare variable $URI as xs:string external;
declare variable $update-collection := "/activity/analytics-read-added";
xdmp:document-add-permissions($URI, xdmp:permission("act-read-role","read")),
xdmp:document-add-collections($URI, $update-collection)如果您需要排除故障并调查流程模块不工作的原因,有时最容易的方法是将Process的内容粘贴到查询控制台,为$URI变量分配一个值,然后在QConsole中执行。
例如:
declare variable $URI as xs:string external := "/some/test/doc.xml";https://stackoverflow.com/questions/45579309
复制相似问题