@@ -37,7 +37,7 @@ declare namespace ext = "http://marklogic.com/rest-api/resource/process";
3737
3838declare variable $PROCESS-MODEL-NAME := test-constants:expected-model-id ($test-constants:TEST-01-MODEL-NAME);
3939
40- let $payload := element ext:createRequest{element ext:processName{$PROCESS-MODEL-NAME},element ext:data{element value {"A" }},element ext:attachments{}}
40+ let $payload := element ext:createRequest{element ext:processName{$PROCESS-MODEL-NAME},element ext:data{element value {"A" }, element assignTo{ "admin" } },element ext:attachments{}}
4141let $process-response := wrt:process-create ($const:xml-options, $payload)[2 ]
4242let $pid := $process-response/ext:createResponse/ext:processId/text ()
4343return
@@ -70,6 +70,44 @@ test:assert-equal(xs:string($process-state/ext:outcome/text()),"SUCCESS"),
7070test:assert-equal ("InclusiveGateway_1" ,fn:tokenize ($current-state,"/" )[fn:last ()])
7171)
7272;
73+
74+ (: test inbox lists wf:user processinbox-read :)
75+ import module namespace test-constants = "http://marklogic.com/workflow/test-constants/inclusive-gateway" at "/test/suites/inclusive-gateway/lib/constants.xqy" ;
76+ import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy" ;
77+ import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy" ;
78+ import module namespace test="http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy" ;
79+ declare namespace cpf = "http://marklogic.com/cpf" ;
80+ declare namespace ext = "http://marklogic.com/rest-api/resource/processinbox" ;
81+ declare namespace http = "xdmp:http" ;
82+ declare namespace prop = "http://marklogic.com/xdmp/property" ;
83+ declare namespace wf="http://marklogic.com/workflow" ;
84+
85+ let $_pause := xdmp:sleep (10000 )
86+ let $test-pid := fn:doc (test-constants:test-pid-uri ($test-constants:TEST-01-MODEL-NAME))/test-constants:pid/text ()
87+ let $child-pid := /wf:process[fn:matches (wf:parent ,$test-pid)]/@id/fn:string ()
88+ let $result := wrt:test-08-processinbox-read ($const:xml-options)
89+ return (
90+ test:assert-equal ('200' , xs:string ($result[1 ]/http:code)),
91+ test:assert-equal ('SUCCESS' , xs:string ($result[2 ]/ext:readResponse/ext:outcome)),
92+ test:assert-exists ($result[2 ]/ext:readResponse/wf:inbox/wf:task[@processid=$child-pid]),
93+ let $task := $result[2 ]/ext:readResponse/wf:inbox/wf:task[@processid=$child-pid]
94+ return (
95+ test:assert-exists ($task/wf:process-data/wf:process/wf:data),
96+ test:assert-exists ($task/wf:process-data/wf:process/wf:attachments),
97+ test:assert-exists ($task/wf:process-data/wf:process/wf:audit-trail),
98+ test:assert-exists ($task/wf:process-data/wf:process/wf:metrics),
99+ test:assert-exists ($task/wf:process-data/wf:process/wf:process-definition-name),
100+ let $properties := $task/wf:process-properties/prop:properties
101+ return (
102+ test:assert-equal ('done' , xs:string ($properties/cpf:processing-status)),
103+ test:assert-equal ('dynamicUser' , xs:string ($properties/wf:currentStep/wf:type )),
104+ test:assert-equal ('admin' , xs:string ($properties/wf:currentStep/wf:user)),
105+ test:assert-equal ('userTask' , xs:string ($properties/wf:currentStep/wf:step-type )),
106+ test:assert-equal ('ENTERED' , xs:string ($properties/wf:currentStep/wf:step-status))
107+ )
108+ )
109+ );
110+
73111(:
74112 Fork has not rendezvoused because there is a user task requiring completion. We therefore complete it
75113:)
@@ -90,6 +128,7 @@ test:assert-equal(xs:string($update-response/ext:outcome/text()),"SUCCESS")
90128(: Need to sleep to ensure asynchronous behaviour has completed :)
91129xdmp:sleep (2000 )
92130;
131+
93132(:
94133 Check process has rendezvoused and completed
95134:)
0 commit comments