Skip to content
This repository was archived by the owner on Nov 9, 2022. It is now read-only.

Commit 3547fc9

Browse files
committed
process-create works with JSON
1 parent bdefd35 commit 3547fc9

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

src/test/suites/shtests-json/015-processmodel-json.xqy

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,13 @@ import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/t
6464
declare namespace ext = "http://marklogic.com/rest-api/resource/process";
6565
declare namespace http = "xdmp:http";
6666

67-
(: JSON not working ! :)
6867
let $payload := doc("/raw/data/06-payload.xml")
69-
let $result := wrt:process-create($c:xml-options, $payload)
68+
let $result := wrt:process-create($c:json-options, $payload)
7069
return (
71-
(:
7270
test:assert-equal('200', xs:string($result[1]/http:code)),
7371
test:assert-equal('SUCCESS', xs:string($result[2]/createResponse/outcome)),
7472
test:assert-exists(xs:string($result[2]/createResponse/processId)),
75-
xdmp:set-session-field("processId", xs:string($result[2]/createResponse/processId)),
76-
xdmp:log(fn:concat("processId:", xdmp:quote($result[2])))
77-
:)
78-
test:assert-equal('200', xs:string($result[1]/http:code)),
79-
test:assert-equal('SUCCESS', xs:string($result[2]/ext:createResponse/ext:outcome)),
80-
test:assert-exists(xs:string($result[2]/ext:createResponse/ext:processId)),
81-
xdmp:document-insert("/test/processId.xml", <test><processId>{xs:string($result[2]/ext:createResponse/ext:processId)}</processId></test>),
73+
xdmp:document-insert("/test/processId.xml", <test><processId>{xs:string($result[2]/createResponse/processId)}</processId></test>),
8274
xdmp:log(fn:concat("processId:", xdmp:quote($result[2])))
8375
);
8476

src/test/workflow-rest-tests.xqy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ declare function wrt:test-09-11-12-xml-payload ($pid)
77
{
88
<ext:updateRequest xmlns:ext="http://marklogic.com/rest-api/resource/process" xmlns:wf="http://marklogic.com/workflow">
99
<ext:processId>{$pid}</ext:processId>
10-
<wf:data></wf:data>
11-
<wf:attachments></wf:attachments>
10+
<wf:data>
11+
</wf:data>
12+
<wf:attachments>
13+
</wf:attachments>
1214
</ext:updateRequest>
1315
};
1416

0 commit comments

Comments
 (0)