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

Commit 7cd0be9

Browse files
committed
Process delete plus testing
1 parent ac381dc commit 7cd0be9

File tree

9 files changed

+297
-7
lines changed

9 files changed

+297
-7
lines changed

rest-api/ext/process.xqy

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,8 @@ declare
270270
%roxy:params("")
271271
function ext:delete(
272272
$context as map:map,
273-
$params as map:map,
274-
$input as document-node()*
275-
) as document-node()* {
273+
$params as map:map
274+
) as document-node()? {
276275

277276
let $preftype := if ("application/xml" = map:get($context,"accept-types")) then "application/xml" else "application/json"
278277

src/test/suites/inclusive-gateway/suite-teardown.xqy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ return
1414
(: Delete processes generated by these tests :)
1515
/wf:process[wf:process-definition-name = $process-model-name] ! xdmp:document-delete(fn:base-uri(.)),
1616
(: Remove children of these processes :)
17-
let $test-pid := fn:doc(test-constants:test-pid-uri($test-constants:TEST-01-MODEL-NAME))/test-constants:pid/text()
17+
let $test-pid := fn:doc(test-constants:test-pid-uri($process-model-name))/test-constants:pid/text()
1818
return
1919
/wf:process[fn:matches(wf:process-definition-name,$process-model-name)] ! xdmp:document-delete(fn:base-uri(.)),
2020
(: Delete test pid document :)
21-
xdmp:document-delete(test-constants:test-pid-uri($test-constants:TEST-01-MODEL-NAME)),
21+
xdmp:document-delete(test-constants:test-pid-uri($process-model-name)),
2222
(: Delete model files :)
23-
cts:uris()[fn:matches(.,test-constants:file-name-for-model($test-constants:TEST-01-MODEL-NAME))] ! xdmp:document-delete(.),
23+
cts:uris()[fn:matches(.,test-constants:file-name-for-model($process-model-name))] ! xdmp:document-delete(.),
2424
(: Delete associated pipelines :)
25-
//p:pipeline-name[fn:matches(.,$test-constants:TEST-01-MODEL-NAME)] ! xdmp:document-delete(fn:base-uri(.))
25+
//p:pipeline-name[fn:matches(.,$process-model-name)] ! xdmp:document-delete(fn:base-uri(.))
2626
)
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
(:
2+
This test checks that process deletes occur correctly. Key point is that recursion is required due to potential creation of sub-processes
3+
:)
4+
(: Start by removing any existing processes:)
5+
declare namespace wf="http://marklogic.com/workflow";
6+
7+
/wf:process ! xdmp:document-delete(fn:base-uri(.))
8+
,
9+
xdmp:trace("ml-workflow","in delete-test.xqy")
10+
;
11+
(:
12+
Create process model for Inclusive Gateway Test 02, and check it has been created correctly
13+
:)
14+
import module namespace test-config = "http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
15+
import module namespace test = "http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
16+
import module namespace test-constants = "http://marklogic.com/workflow/test-constants/inclusive-gateway" at "/test/suites/inclusive-gateway/lib/constants.xqy";
17+
18+
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
19+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
20+
21+
declare namespace model = "http://marklogic.com/rest-api/resource/processmodel";
22+
23+
declare variable $MODEL-INPUT-FILE-NAME := test-constants:file-name-for-model($test-constants:TEST-02-MODEL-NAME);
24+
25+
declare option xdmp:mapping "false";
26+
27+
let $model-response := wrt:processmodel-create ($const:xml-options, $MODEL-INPUT-FILE-NAME)[2]
28+
return
29+
(
30+
test:assert-equal(xs:string($model-response/model:createResponse/model:outcome/text()),"SUCCESS"),
31+
test:assert-equal(xs:string($model-response/model:createResponse/model:modelId/text()),test-constants:expected-model-id($test-constants:TEST-02-MODEL-NAME))
32+
)
33+
;
34+
(:
35+
Create process for Inclusive Gateway Test 02. Check success. Check pid exists and save.
36+
:)
37+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
38+
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
39+
import module namespace test-constants = "http://marklogic.com/workflow/test-constants/inclusive-gateway" at "/test/suites/inclusive-gateway/lib/constants.xqy";
40+
import module namespace test = "http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
41+
42+
declare namespace ext = "http://marklogic.com/rest-api/resource/process";
43+
44+
declare variable $PROCESS-MODEL-NAME := test-constants:expected-model-id($test-constants:TEST-02-MODEL-NAME);
45+
46+
let $payload := element ext:createRequest{element ext:processName{$PROCESS-MODEL-NAME},element ext:data{element value1{"A"},element value2{"B"}},element ext:attachments{}}
47+
let $process-response := wrt:process-create($const:xml-options, $payload)[2]
48+
let $pid := $process-response/ext:createResponse/ext:processId/text()
49+
return
50+
(
51+
test:assert-equal(xs:string($process-response/ext:createResponse/ext:outcome/text()),"SUCCESS"),
52+
test:assert-exists($pid),
53+
test-constants:save-pid($pid,$test-constants:TEST-02-MODEL-NAME)
54+
)
55+
;
56+
(: Need to sleep to ensure asynchronous behaviour has completed :)
57+
import module namespace test-config = "http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
58+
59+
test-config:test-sleep()
60+
;
61+
(:
62+
There should be three process documents - parent process and two child processes
63+
:)
64+
import module namespace test = "http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
65+
66+
declare namespace wf="http://marklogic.com/workflow";
67+
68+
test:assert-equal(3,fn:count(/wf:process));
69+
70+
(:
71+
Delete process
72+
:)
73+
import module namespace test-constants = "http://marklogic.com/workflow/test-constants/inclusive-gateway" at "/test/suites/inclusive-gateway/lib/constants.xqy";
74+
(:import module namespace wfu="http://marklogic.com/workflow-util" at "/workflowengine/models/workflow-util.xqy";:)
75+
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
76+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
77+
78+
let $test-pid := fn:doc(test-constants:test-pid-uri($test-constants:TEST-02-MODEL-NAME))/test-constants:pid/text()
79+
return
80+
wrt:process-delete($const:xml-options,$test-pid)[0]
81+
82+
;
83+
(:
84+
There should now be no process documents
85+
:)
86+
import module namespace test = "http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
87+
88+
declare namespace wf="http://marklogic.com/workflow";
89+
90+
test:assert-equal(0,fn:count(/wf:process))
91+
;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module namespace test-constants = "http://marklogic.com/workflow/test-constants/inclusive-gateway";
2+
3+
declare option xdmp:mapping "false";
4+
5+
declare variable $TEST-02-MODEL-NAME := "InclusiveGatewayTest-02";
6+
declare variable $TEST-MODEL-NAMES := ($TEST-02-MODEL-NAME);
7+
declare variable $TEST-FILES := $TEST-MODEL-NAMES ! file-name-for-model(.);
8+
declare variable $TEST-PID-DIR := "/test/pid/";
9+
10+
declare function file-name-for-model($model-name as xs:string){
11+
$model-name||".bpmn"
12+
};
13+
14+
declare function expected-model-id($model-name) as xs:string{
15+
$model-name||"__1__0"
16+
};
17+
18+
declare function test-pid-uri($model-name as xs:string) as xs:string{
19+
$TEST-PID-DIR||$model-name||".xml"
20+
};
21+
22+
declare function save-pid($pid,$model-name){
23+
let $pid-content := element test-constants:pid{$pid}
24+
return
25+
xdmp:document-insert(test-pid-uri($model-name),$pid-content)
26+
};
27+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
xquery version "1.0-ml";
2+
3+
import module namespace test-config = "http://marklogic.com/roxy/test-config" at "/test/test-config.xqy";
4+
import module namespace test = "http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
5+
import module namespace test-constants = "http://marklogic.com/workflow/test-constants/inclusive-gateway" at "lib/constants.xqy";
6+
7+
8+
for $test-file in $test-constants:TEST-FILES
9+
let $target-uri := test-config:local-uri-for-test-file($test-file)
10+
return
11+
test:load-test-file($test-file, xdmp:database(), $target-uri)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import module namespace test-constants = "http://marklogic.com/workflow/test-constants/inclusive-gateway" at "lib/constants.xqy";
2+
import module namespace const="http://marklogic.com/roxy/workflow-constants" at "/test/workflow-constants.xqy";
3+
import module namespace wrt="http://marklogic.com/workflow/rest-tests" at "/test/workflow-rest-tests.xqy";
4+
import module namespace test = "http://marklogic.com/roxy/test-helper" at "/test/test-helper.xqy";
5+
6+
declare namespace ext = "http://marklogic.com/rest-api/resource/process";
7+
declare namespace wf = "http://marklogic.com/workflow";
8+
declare namespace p = "http://marklogic.com/cpf/pipelines";
9+
10+
11+
for $process-model-name in $test-constants:TEST-MODEL-NAMES
12+
return
13+
(
14+
(: Delete processes generated by these tests :)
15+
/wf:process[wf:process-definition-name = $process-model-name] ! xdmp:document-delete(fn:base-uri(.)),
16+
(: Remove children of these processes :)
17+
let $test-pid := fn:doc(test-constants:test-pid-uri($process-model-name))/test-constants:pid/text()
18+
return
19+
/wf:process[fn:matches(wf:process-definition-name,$process-model-name)] ! xdmp:document-delete(fn:base-uri(.)),
20+
(: Delete test pid document :)
21+
xdmp:document-delete(test-constants:test-pid-uri($process-model-name)),
22+
(: Delete model files :)
23+
cts:uris()[fn:matches(.,test-constants:file-name-for-model($process-model-name))] ! xdmp:document-delete(.),
24+
(: Delete associated pipelines :)
25+
//p:pipeline-name[fn:matches(.,$process-model-name)] ! xdmp:document-delete(fn:base-uri(.))
26+
)
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- origin at X=0.0 Y=0.0 -->
3+
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xs="http://www.w3.org/2001/XMLSchema" id="_GqqWIBraEeiDzsBG-Hp4NA" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.4.2.Final-v20171109-1930-B1">
4+
<bpmn2:itemDefinition id="ItemDefinition_18" isCollection="false" structureRef="xs:boolean"/>
5+
<bpmn2:process id="Process_1" name="Process 1" isExecutable="false">
6+
<bpmn2:startEvent id="StartEvent_1" name="Start">
7+
<bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
8+
</bpmn2:startEvent>
9+
<bpmn2:endEvent id="EndEvent_1" name="End">
10+
<bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>
11+
</bpmn2:endEvent>
12+
<bpmn2:inclusiveGateway id="InclusiveGateway_1" name="InclusiveGatewayDiverging" gatewayDirection="Diverging">
13+
<bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
14+
<bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
15+
<bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
16+
</bpmn2:inclusiveGateway>
17+
<bpmn2:inclusiveGateway id="InclusiveGateway_2" name="InclusiveGatewayConverging" gatewayDirection="Converging">
18+
<bpmn2:incoming>SequenceFlow_3</bpmn2:incoming>
19+
<bpmn2:incoming>SequenceFlow_4</bpmn2:incoming>
20+
<bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing>
21+
</bpmn2:inclusiveGateway>
22+
<bpmn2:userTask id="UserTask_1" name="TaskA">
23+
<bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
24+
<bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing>
25+
</bpmn2:userTask>
26+
<bpmn2:userTask id="UserTask_2" name="TaskB">
27+
<bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
28+
<bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing>
29+
</bpmn2:userTask>
30+
<bpmn2:sequenceFlow id="SequenceFlow_1" sourceRef="InclusiveGateway_1" targetRef="UserTask_1">
31+
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_1" evaluatesToTypeRef="ItemDefinition_18" language="http://www.w3.org/1999/XPath">/wf:process/wf:data/value1 = 'A'</bpmn2:conditionExpression>
32+
</bpmn2:sequenceFlow>
33+
<bpmn2:sequenceFlow id="SequenceFlow_2" sourceRef="InclusiveGateway_1" targetRef="UserTask_2">
34+
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_2" language="http://www.w3.org/1999/XPath">/wf:process/wf:data/value2 = 'B'</bpmn2:conditionExpression>
35+
</bpmn2:sequenceFlow>
36+
<bpmn2:sequenceFlow id="SequenceFlow_3" sourceRef="UserTask_1" targetRef="InclusiveGateway_2"/>
37+
<bpmn2:sequenceFlow id="SequenceFlow_4" sourceRef="UserTask_2" targetRef="InclusiveGateway_2"/>
38+
<bpmn2:sequenceFlow id="SequenceFlow_5" sourceRef="InclusiveGateway_2" targetRef="EndEvent_1"/>
39+
<bpmn2:sequenceFlow id="SequenceFlow_6" sourceRef="StartEvent_1" targetRef="InclusiveGateway_1"/>
40+
</bpmn2:process>
41+
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
42+
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
43+
<bpmndi:BPMNShape id="BPMNShape_StartEvent_1" bpmnElement="StartEvent_1">
44+
<dc:Bounds height="36.0" width="36.0" x="150.0" y="255.0"/>
45+
<bpmndi:BPMNLabel id="BPMNLabel_1" labelStyle="BPMNLabelStyle_1">
46+
<dc:Bounds height="16.0" width="29.0" x="153.0" y="291.0"/>
47+
</bpmndi:BPMNLabel>
48+
</bpmndi:BPMNShape>
49+
<bpmndi:BPMNShape id="BPMNShape_EndEvent_1" bpmnElement="EndEvent_1">
50+
<dc:Bounds height="36.0" width="36.0" x="800.0" y="255.0"/>
51+
<bpmndi:BPMNLabel id="BPMNLabel_2" labelStyle="BPMNLabelStyle_1">
52+
<dc:Bounds height="16.0" width="24.0" x="806.0" y="291.0"/>
53+
</bpmndi:BPMNLabel>
54+
</bpmndi:BPMNShape>
55+
<bpmndi:BPMNShape id="BPMNShape_InclusiveGateway_1" bpmnElement="InclusiveGateway_1" isMarkerVisible="true">
56+
<dc:Bounds height="50.0" width="50.0" x="350.0" y="248.0"/>
57+
<bpmndi:BPMNLabel id="BPMNLabel_3" labelStyle="BPMNLabelStyle_1">
58+
<dc:Bounds height="48.0" width="58.0" x="346.0" y="298.0"/>
59+
</bpmndi:BPMNLabel>
60+
</bpmndi:BPMNShape>
61+
<bpmndi:BPMNShape id="BPMNShape_InclusiveGateway_2" bpmnElement="InclusiveGateway_2" isMarkerVisible="true">
62+
<dc:Bounds height="50.0" width="50.0" x="600.0" y="248.0"/>
63+
<bpmndi:BPMNLabel id="BPMNLabel_4" labelStyle="BPMNLabelStyle_1">
64+
<dc:Bounds height="48.0" width="69.0" x="591.0" y="298.0"/>
65+
</bpmndi:BPMNLabel>
66+
</bpmndi:BPMNShape>
67+
<bpmndi:BPMNShape id="BPMNShape_UserTask_1" bpmnElement="UserTask_1" isExpanded="true">
68+
<dc:Bounds height="50.0" width="110.0" x="450.0" y="153.0"/>
69+
<bpmndi:BPMNLabel id="BPMNLabel_5" labelStyle="BPMNLabelStyle_1">
70+
<dc:Bounds height="16.0" width="39.0" x="485.0" y="170.0"/>
71+
</bpmndi:BPMNLabel>
72+
</bpmndi:BPMNShape>
73+
<bpmndi:BPMNShape id="BPMNShape_UserTask_2" bpmnElement="UserTask_2" isExpanded="true">
74+
<dc:Bounds height="50.0" width="110.0" x="450.0" y="348.0"/>
75+
<bpmndi:BPMNLabel id="BPMNLabel_6" labelStyle="BPMNLabelStyle_1">
76+
<dc:Bounds height="16.0" width="39.0" x="485.0" y="365.0"/>
77+
</bpmndi:BPMNLabel>
78+
</bpmndi:BPMNShape>
79+
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="BPMNShape_InclusiveGateway_1" targetElement="BPMNShape_UserTask_1">
80+
<di:waypoint xsi:type="dc:Point" x="375.0" y="248.0"/>
81+
<di:waypoint xsi:type="dc:Point" x="375.0" y="178.0"/>
82+
<di:waypoint xsi:type="dc:Point" x="450.0" y="178.0"/>
83+
<bpmndi:BPMNLabel id="BPMNLabel_7"/>
84+
</bpmndi:BPMNEdge>
85+
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="BPMNShape_InclusiveGateway_1" targetElement="BPMNShape_UserTask_2">
86+
<di:waypoint xsi:type="dc:Point" x="375.0" y="298.0"/>
87+
<di:waypoint xsi:type="dc:Point" x="375.0" y="373.0"/>
88+
<di:waypoint xsi:type="dc:Point" x="450.0" y="373.0"/>
89+
<bpmndi:BPMNLabel id="BPMNLabel_8"/>
90+
</bpmndi:BPMNEdge>
91+
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_3" sourceElement="BPMNShape_UserTask_1" targetElement="BPMNShape_InclusiveGateway_2">
92+
<di:waypoint xsi:type="dc:Point" x="560.0" y="178.0"/>
93+
<di:waypoint xsi:type="dc:Point" x="625.0" y="178.0"/>
94+
<di:waypoint xsi:type="dc:Point" x="625.0" y="248.0"/>
95+
<bpmndi:BPMNLabel id="BPMNLabel_9"/>
96+
</bpmndi:BPMNEdge>
97+
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_4" sourceElement="BPMNShape_UserTask_2" targetElement="BPMNShape_InclusiveGateway_2">
98+
<di:waypoint xsi:type="dc:Point" x="560.0" y="373.0"/>
99+
<di:waypoint xsi:type="dc:Point" x="625.0" y="373.0"/>
100+
<di:waypoint xsi:type="dc:Point" x="625.0" y="298.0"/>
101+
<bpmndi:BPMNLabel id="BPMNLabel_10"/>
102+
</bpmndi:BPMNEdge>
103+
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="BPMNShape_InclusiveGateway_2" targetElement="BPMNShape_EndEvent_1">
104+
<di:waypoint xsi:type="dc:Point" x="650.0" y="273.0"/>
105+
<di:waypoint xsi:type="dc:Point" x="725.0" y="273.0"/>
106+
<di:waypoint xsi:type="dc:Point" x="800.0" y="273.0"/>
107+
<bpmndi:BPMNLabel id="BPMNLabel_11"/>
108+
</bpmndi:BPMNEdge>
109+
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="BPMNShape_StartEvent_1" targetElement="BPMNShape_InclusiveGateway_1">
110+
<di:waypoint xsi:type="dc:Point" x="186.0" y="273.0"/>
111+
<di:waypoint xsi:type="dc:Point" x="268.0" y="273.0"/>
112+
<di:waypoint xsi:type="dc:Point" x="350.0" y="273.0"/>
113+
<bpmndi:BPMNLabel id="BPMNLabel_12"/>
114+
</bpmndi:BPMNEdge>
115+
</bpmndi:BPMNPlane>
116+
<bpmndi:BPMNLabelStyle id="BPMNLabelStyle_1">
117+
<dc:Font name="arial" size="9.0"/>
118+
</bpmndi:BPMNLabelStyle>
119+
</bpmndi:BPMNDiagram>
120+
</bpmn2:definitions>

src/test/workflow-rest-tests.xqy

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,12 @@ declare function wrt:call-complete-on-pid($options as element(http:options),$pid
280280
fn:encode-for-uri($pid), "&amp;rs:complete=true")
281281
return xdmp:http-post($uri, $options, $payload)[2]
282282
};
283+
284+
declare function wrt:process-delete($options as element(http:options),$pid as xs:string){
285+
let $uri := fn:concat(
286+
"http://", $const:RESTHOST, ':', $const:RESTPORT,
287+
"/v1/resources/process?rs:processid=",
288+
fn:encode-for-uri($pid)
289+
)
290+
return xdmp:http-delete($uri, $options)[2]
291+
};

src/workflowengine/models/workflow-util.xqy

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,16 @@ declare function m:get($processId as xs:string) as element(wf:process)? {
9797
:)
9898
declare function m:delete($processId as xs:string) as empty-sequence() {
9999
let $process-uri := m:getProcessUri($processId)
100+
let $children as xs:string* := cts:search(/,cts:element-value-query(xs:QName("wf:parent"),$process-uri))/wf:process/@id
100101
return
102+
(
103+
(: Delete parent :)
101104
if(fn:doc-available($process-uri)) then xdmp:document-delete($process-uri)
102105
else ()
106+
,
107+
(: Delete children :)
108+
$children ! m:delete(.)
109+
)
103110
};
104111

105112
(:

0 commit comments

Comments
 (0)