11xquery version "1.0-ml" ;
22
33(: 21-processmodel-create :)
4- import module namespace c ="http://marklogic.com/roxy/test-config " at "/test/test-config .xqy" ;
4+ import module namespace const ="http://marklogic.com/roxy/workflow-constants " at "/test/workflow-constants .xqy" ;
55import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy" ;
66import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy" ;
77declare namespace ext = "http://marklogic.com/rest-api/resource/processmodel" ;
88declare namespace http = "xdmp:http" ;
99
10- let $process := wrt:processmodel-create ($c :json-options, "022-email-test.bpmn" )
10+ let $process := wrt:processmodel-create ($const :json-options, "022-email-test.bpmn" )
1111(: not working with XML ? :)
1212return ( (:
1313 test:assert-equal('200', xs:string($process[1]/http:code)),
@@ -19,14 +19,14 @@ return ( (:
1919);
2020
2121(: 22-processmodel-publish :)
22- import module namespace c ="http://marklogic.com/roxy/test-config " at "/test/test-config .xqy" ;
22+ import module namespace const ="http://marklogic.com/roxy/workflow-constants " at "/test/workflow-constants .xqy" ;
2323import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy" ;
2424import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy" ;
2525declare namespace ext = "http://marklogic.com/rest-api/resource/processmodel" ;
2626declare namespace http = "xdmp:http" ;
2727
2828(: not working with XML ? :)
29- let $result := wrt:processmodel-publish ($c :json-options, "022-email-test__1__0" )
29+ let $result := wrt:processmodel-publish ($const :json-options, "022-email-test__1__0" )
3030return ( (:
3131 test:assert-equal('200', xs:string($result[1]/http:code)),
3232 test:assert-equal('SUCCESS', xs:string($result[2]/ext:updateResponse/ext:outcome)),
@@ -37,14 +37,14 @@ return ( (:
3737);
3838
3939(: 23-process-create :)
40- import module namespace c ="http://marklogic.com/roxy/test-config " at "/test/test-config .xqy" ;
40+ import module namespace const ="http://marklogic.com/roxy/workflow-constants " at "/test/workflow-constants .xqy" ;
4141import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy" ;
4242import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy" ;
4343declare namespace ext = "http://marklogic.com/rest-api/resource/process" ;
4444declare namespace http = "xdmp:http" ;
4545
4646let $payload := doc ("/raw/data/23-payload.xml" )
47- let $result := wrt:process-create ($c :xml-options, $payload)
47+ let $result := wrt:process-create ($const :xml-options, $payload)
4848return (
4949 test:assert-equal ('200' , xs:string ($result[1 ]/http:code)),
5050 test:assert-equal ('SUCCESS' , xs:string ($result[2 ]/ext:createResponse/ext:outcome)),
@@ -54,113 +54,113 @@ return (
5454);
5555
5656(: 24-process-read :)
57- import module namespace c ="http://marklogic.com/roxy/test-config " at "/test/test-config .xqy" ;
57+ import module namespace const ="http://marklogic.com/roxy/workflow-constants " at "/test/workflow-constants .xqy" ;
5858import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy" ;
5959import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy" ;
6060declare namespace ext = "http://marklogic.com/rest-api/resource/process" ;
6161declare namespace http = "xdmp:http" ;
6262
6363let $pid := xs:string (doc ("/test/processId.xml" )/test/processId)
64- let $result := wrt:process-read ($c :xml-options, $pid)
64+ let $result := wrt:process-read ($const :xml-options, $pid)
6565return (
6666 test:assert-equal ('200' , xs:string ($result[1 ]/http:code)),
6767 test:assert-equal ('SUCCESS' , xs:string ($result[2 ]/ext:readResponse/ext:outcome)),
6868 test:assert-exists ($result[2 ]/ext:readResponse/ext:document )
6969);
7070
7171(: 25-processsubscription-create :)
72- import module namespace c ="http://marklogic.com/roxy/test-config " at "/test/test-config .xqy" ;
72+ import module namespace const ="http://marklogic.com/roxy/workflow-constants " at "/test/workflow-constants .xqy" ;
7373import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy" ;
7474import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy" ;
7575declare namespace ext = "http://marklogic.com/rest-api/resource/processsubscription" ;
7676declare namespace http = "xdmp:http" ;
7777
78- let $result := wrt:test-25-processsubscription-create ($c :xml-options)
78+ let $result := wrt:test-25-processsubscription-create ($const :xml-options)
7979return (
8080 test:assert-equal ('200' , xs:string ($result[1 ]/http:code)),
8181 test:assert-equal ('SUCCESS' , xs:string ($result[2 ]/ext:createResponse/ext:outcome)),
8282 test:assert-equal ('/config/alerts/email-sub-test' , xs:string ($result[2 ]/ext:createResponse/ext:subscriptionId))
8383);
8484
8585(: 26-processsubscription-read :)
86- import module namespace c ="http://marklogic.com/roxy/test-config " at "/test/test-config .xqy" ;
86+ import module namespace const ="http://marklogic.com/roxy/workflow-constants " at "/test/workflow-constants .xqy" ;
8787import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy" ;
8888import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy" ;
8989declare namespace alert = "http://marklogic.com/xdmp/alert" ;
9090declare namespace ext = "http://marklogic.com/rest-api/resource/processsubscription" ;
9191declare namespace http = "xdmp:http" ;
9292
93- let $result := wrt:test-26-processsubscription-read ($c :xml-options)
93+ let $result := wrt:test-26-processsubscription-read ($const :xml-options)
9494return (
9595 test:assert-equal ('200' , xs:string ($result[1 ]/http:code)),
9696 test:assert-equal ('SUCCESS' , xs:string ($result[2 ]/ext:readResponse/ext:outcome)),
9797 test:assert-equal ('/config/alerts/email-sub-test' , xs:string ($result[2 ]/ext:readResponse/ext:subscription/alert:config/alert:config-uri))
9898);
9999
100100(: 27-document-create :)
101- import module namespace c ="http://marklogic.com/roxy/test-config " at "/test/test-config .xqy" ;
101+ import module namespace const ="http://marklogic.com/roxy/workflow-constants " at "/test/workflow-constants .xqy" ;
102102import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy" ;
103103import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy" ;
104104declare namespace ext = "http://marklogic.com/rest-api/resource/processsubscription" ;
105105declare namespace http = "xdmp:http" ;
106106
107- let $result := wrt:test-27-document-create ($c :xml-options)
107+ let $result := wrt:test-27-document-create ($const :xml-options)
108108return (
109109 test:assert-equal ('201' , xs:string ($result[1 ]/http:code))
110110);
111111
112112(: Search needs to be immediately after - it executes too quick otherwise!!! (A blank result may mean processes already finished, not just haven't started) :)
113113(: 28-processsearch-read :)
114- import module namespace c ="http://marklogic.com/roxy/test-config " at "/test/test-config .xqy" ;
114+ import module namespace const ="http://marklogic.com/roxy/workflow-constants " at "/test/workflow-constants .xqy" ;
115115import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy" ;
116116import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy" ;
117117declare namespace ext = "http://marklogic.com/rest-api/resource/processsearch" ;
118118declare namespace http = "xdmp:http" ;
119119declare namespace wf = "http://marklogic.com/workflow" ;
120120
121- let $result := wrt:test-28-processsearch-read ($c :xml-options)
121+ let $result := wrt:test-28-processsearch-read ($const :xml-options)
122122return (
123123 test:assert-equal ('200' , xs:string ($result[1 ]/http:code)),
124124 test:assert-equal ('SUCCESS' , xs:string ($result[2 ]/ext:readResponse/ext:outcome)),
125125 test:assert-exists ($result[2 ]/ext:readResponse/wf:list)
126126);
127127
128128(: 29-processasset-create :)
129- import module namespace c ="http://marklogic.com/roxy/test-config " at "/test/test-config .xqy" ;
129+ import module namespace const ="http://marklogic.com/roxy/workflow-constants " at "/test/workflow-constants .xqy" ;
130130import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy" ;
131131import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy" ;
132132declare namespace ext = "http://marklogic.com/rest-api/resource/processasset" ;
133133declare namespace http = "xdmp:http" ;
134134
135- let $result := wrt:test-29-processasset-create ($c :xml-options)
135+ let $result := wrt:test-29-processasset-create ($const :xml-options)
136136return (
137137 test:assert-equal ('200' , xs:string ($result[1 ]/http:code)),
138138 test:assert-equal ('SUCCESS' , xs:string ($result[2 ]/ext:createResponse/ext:outcome)),
139139 test:assert-equal ('/workflowengine/assets/021-initiating-attachment/1/3/RejectedEmail.txt' , xs:string ($result[2 ]/ext:createResponse/ext:assetUri))
140140);
141141
142142(: 30-processasset-read :)
143- import module namespace c ="http://marklogic.com/roxy/test-config " at "/test/test-config .xqy" ;
143+ import module namespace const ="http://marklogic.com/roxy/workflow-constants " at "/test/workflow-constants .xqy" ;
144144import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy" ;
145145import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy" ;
146146declare namespace em = "URN:ietf:params:email-xml:" ;
147147declare namespace http = "xdmp:http" ;
148148declare namespace rf = "URN:ietf:params:rfc822:" ;
149149
150- let $result := wrt:test-30-processasset-read ($c :xml-options)
150+ let $result := wrt:test-30-processasset-read ($const :xml-options)
151151return (
152152 test:assert-equal ('200' , xs:string ($result[1 ]/http:code)) (:,
153153 test:assert-equal('Document Rejected', xs:string($result[2]/em:Message/rf:subject)) :)
154154);
155155
156156(: 31-processasset-delete :)
157- import module namespace c ="http://marklogic.com/roxy/test-config " at "/test/test-config .xqy" ;
157+ import module namespace const ="http://marklogic.com/roxy/workflow-constants " at "/test/workflow-constants .xqy" ;
158158import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy" ;
159159import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy" ;
160160declare namespace ext = "http://marklogic.com/rest-api/resource/processasset" ;
161161declare namespace http = "xdmp:http" ;
162162
163- let $result := wrt:test-31-processasset-delete ($c :xml-options)
163+ let $result := wrt:test-31-processasset-delete ($const :xml-options)
164164return (
165165 test:assert-equal ('200' , xs:string ($result[1 ]/http:code)),
166166 test:assert-equal ('SUCCESS' , xs:string ($result[2 ]/ext:deleteResponse/ext:outcome)),
0 commit comments