Skip to content

Commit 1123ae9

Browse files
committed
#231
1 parent 9323f74 commit 1123ae9

File tree

2 files changed

+16
-3
lines changed
  • marklogic-data-hub/src/main/resources/ml-modules

2 files changed

+16
-3
lines changed

marklogic-data-hub/src/main/resources/ml-modules/root/com.marklogic.hub/lib/flow-lib.xqy

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,8 @@ declare function flow:run-flow(
516516
$content as item()?,
517517
$options as map:map) as empty-sequence()
518518
{
519+
(: assert that we are in query mode :)
520+
let $_ts as xs:unsignedLong := xdmp:request-timestamp()
519521
let $envelope := flow:run-plugins($flow, $identifier, $content, $options)
520522
let $_ :=
521523
for $writer in $flow/hub:writer
@@ -760,9 +762,20 @@ declare function flow:run-writer(
760762
let $before := xdmp:elapsed-time()
761763
let $resp :=
762764
try {
763-
xdmp:invoke-function(function() {
765+
xdmp:eval('
766+
declare variable $func external;
767+
declare variable $identifier external;
768+
declare variable $envelope external;
769+
declare variable $options external;
770+
764771
$func($identifier, $envelope, $options)
765-
},
772+
',
773+
map:new((
774+
map:entry("func", $func),
775+
map:entry("identifier", $identifier),
776+
map:entry("envelope", $envelope),
777+
map:entry("options", $options)
778+
)),
766779
map:new((
767780
map:entry("isolation", "different-transaction"),
768781
map:entry("database", xdmp:database($config:FINAL-DATABASE)),

marklogic-data-hub/src/main/resources/ml-modules/services/flow.xqy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ declare function get(
7171
:
7272
: The flow xml is provided in the request body
7373
:)
74-
declare %rapi:transaction-mode("update") function post(
74+
declare function post(
7575
$context as map:map,
7676
$params as map:map,
7777
$input as document-node()*

0 commit comments

Comments
 (0)