You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 9, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: documentation/SPRINTS.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,8 @@ steps if a duplicate is found. Requires search (by property hash AND not (same u
34
34
35
35
## Sprint 1 - Basic workflow
36
36
37
+
Completed Sat 18 Apr 2015 14:30 BST by Adam Fowler
38
+
37
39
- DONE BPMN2: generic blank task
38
40
- DONE BPMN2: user task -> aka human step
39
41
- DONE BPMN2: exclusive gateway -> Decision point with one outcome, multiple options
@@ -50,8 +52,8 @@ steps if a duplicate is found. Requires search (by property hash AND not (same u
50
52
- DONE Tools: Process Data model XSD (for modeler import)
51
53
- DONE Tools: Eclipse BPMN 2 Modeler Palette and Process diagram support, including new diagram creation for MarkLogic
52
54
- DEFERRED UI: Ridiculously basic HTML widget in MLJS for rendering step and choosing action (for ease of testing)
53
-
-TEST Start process using an Alert (content subscription)
54
-
-TEST REST API: Basic process initiation, update and tracking methods
55
+
-DONE Start process using an Alert (content subscription)
56
+
-DONE REST API: Basic process initiation, update and tracking methods
55
57
- DONE processmodel.xqy
56
58
- DONE PUT create and publish process model, accepting BPMN2 content type .bpmn2, and to update process model without publishing
57
59
- DONE GET to fetch process model
@@ -60,8 +62,8 @@ steps if a duplicate is found. Requires search (by property hash AND not (same u
60
62
- DONE PUT create instance of a process (starts a process)
61
63
- DONE POST complete a human task
62
64
- DONE GET fetch the current state of a business process
63
-
-TEST processsubscription.xqy
64
-
-TEST PUT create a process subscription (alert) to create a new process instance (creating a content doc creates a process doc with an initiating attachment)
65
+
-DONE processsubscription.xqy
66
+
-DONE PUT create a process subscription (alert) to create a new process instance (creating a content doc creates a process doc with an initiating attachment)
65
67
- DONE processinbox.xqy
66
68
- DONE processqueue.xqy
67
69
- TEST support for roles (processroleinbox.xqy) on user tasks (For BD)
Copy file name to clipboardExpand all lines: documentation/USING-SUBSCRIPTIONS.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,8 @@ The above is why I decided to have a process document that CPF runs against, rat
21
21
## How it works
22
22
23
23
1. A user, or application, creates a new document in MarkLogic - say a Bank Account Opening E-form
24
-
2. A 'Process Subscription' (basically a MarkLogic alert that uses the alert-action-process.xqy action) fires, creating a new Account Opening process document
25
-
3. A CPF Domain (set up by enabling/publishing a MarkLogic Workflow BPMN2 model) fires for this document, invoking the Account Opening V1.2 CPF pipeline process
24
+
2. A 'Process Subscription' (basically a MarkLogic alert that uses the alert-action-process.xqy action) fires, creating a new Account Opening process document, and attaching the account opening form as the InitiatingAttachment attachment
25
+
3. A CPF Domain (set up by enabling/publishing a MarkLogic Workflow BPMN2 model) fires for this process document, invoking the Account Opening V1.2 CPF pipeline process
26
26
4. CPF manages the state transitions and execution of BPMN2 CPF actions throughout the process lifecycle
27
27
5. Process eventually completes (or fails), leaving the process document as an audit record of what happened, with metrics for performance analysis
28
28
@@ -39,13 +39,19 @@ Several reasons.
39
39
## Isn't it a bit convoluted?
40
40
41
41
If you had to create all these things by hand, yes. This is why the Workflow REST API provides a single endpoint
42
-
(POST /v1/resource/process) to take a BPMN2 model, create a set of CPF pipelines, and create a
42
+
(POST /v1/resources/process) to take a BPMN2 model, create a set of CPF pipelines, and create a
43
43
domain configuration, for you.
44
44
45
45
All you then need to do then is separately configure one or more Alerts (aka Process Subscriptions) via calls to
46
-
PUT /v1/resource/processsubscription to start the relevant workflow based on criteria about a new or updated document
46
+
PUT /v1/resources/processsubscription to start the relevant workflow based on criteria about a new or updated document
47
47
in marklogic.
48
48
49
-
Alternatively, manually start a process via PUT /v1/resource/process without needing a Process Subscription. This is useful
49
+
Alternatively, manually start a process via PUT /v1/resources/process without needing a Process Subscription. This is useful
50
50
if starting a process via an ESB or application. A good example is starting a process to tell a person to create a
51
51
new document that doesn't exist yet.
52
+
53
+
## Examples
54
+
55
+
For examples of how to configure and call the REST extensions for alerting, see the /shtests/ folder, specifically:-
56
+
- Automated start: 25-payload.xml and 25-processsubscription-create.sh
declarefunctionss:create-config($shortname as xs:string) as xs:string {
310
344
(: add alert :)
311
345
let $alert-name := "/config/alerts/" || $shortname
@@ -318,7 +352,7 @@ declare function ss:create-config($shortname as xs:string) as xs:string {
318
352
return $alert-name
319
353
};
320
354
321
-
declarefunctionss:create-rule($alert-name as xs:string,$query as cts:query,$options aselement()*) {
355
+
declarefunctionss:create-rule($alert-name as xs:string,$query as cts:query,$options aselement()*) asempty-sequence() {
322
356
323
357
let $rule := alert:make-rule(
324
358
fn:concat($alert-name,"-rule"),
@@ -347,7 +381,6 @@ declare function ss:create-action($alert-name as xs:string,$alert-module as xs:s
347
381
348
382
349
383
350
-
(: TODO add method for creating cpf domain, and enabling cpf on the database automatically - see 8001 admin code :)
351
384
352
385
353
386
declarefunctionss:cpf-enable($alert-name as xs:string,$cpf-domain as xs:string) {
@@ -356,3 +389,77 @@ declare function ss:cpf-enable($alert-name as xs:string,$cpf-domain as xs:string
356
389
alert:config-get($alert-name),
357
390
($cpf-domain)))
358
391
};
392
+
393
+
declarefunctionss:create-domain($domainname as xs:string,$domaintype as xs:string,$domainpath as xs:string,$domaindepth as xs:string,$pipeline-names as xs:string*,$modulesdb as xs:string) as xs:unsignedLong {
394
+
395
+
(: check if domain already exists and recreate :)
396
+
let $remove :=
397
+
try {
398
+
if (fn:not(fn:empty(
399
+
xdmp:eval(
400
+
'xquery version "1.0-ml";declare namespace m="http://marklogic.com/alerts"; import module namespace dom = "http://marklogic.com/cpf/domains" at "/MarkLogic/cpf/domains.xqy";declare variable $m:processmodeluri as xs:string external; dom:get($m:processmodeluri)'
401
+
,
402
+
(xs:QName("my:processmodeluri"),$domainname),
403
+
<options xmlns="xdmp:eval">
404
+
<database>{xdmp:triggers-database()}</database>
405
+
<isolation>different-transaction</isolation>
406
+
</options>
407
+
)
408
+
))) then
409
+
let $_ := xdmp:log(" GOT DOMAIN TO REMOVE")
410
+
return
411
+
xdmp:eval(
412
+
'xquery version "1.0-ml";declare namespace m="http://marklogic.com/alerts"; import module namespace dom = "http://marklogic.com/cpf/domains" at "/MarkLogic/cpf/domains.xqy";declare variable $m:processmodeluri as xs:string external;'
413
+
||
414
+
'dom:remove($m:processmodeluri)'
415
+
,
416
+
(xs:QName("my:processmodeluri"),$domainname),
417
+
<options xmlns="xdmp:eval">
418
+
<database>{xdmp:triggers-database()}</database>
419
+
<isolation>different-transaction</isolation>
420
+
</options>
421
+
)
422
+
else
423
+
()
424
+
} catch ($e) { ( xdmp:log("Error trying to remove domain: " || $domainname),xdmp:log($e) ) } (: catching domain throwing error if it doesn't exist. We can safely ignore this :)
425
+
426
+
427
+
(: Create domain :)
428
+
429
+
(: Configure domain :)
430
+
return
431
+
xdmp:eval(
432
+
'xquery version "1.0-ml";declare namespace m="http://marklogic.com/alerts";' ||
433
+
'import module namespace p="http://marklogic.com/cpf/pipelines" at "/MarkLogic/cpf/pipelines.xqy"; '||
434
+
'import module namespace dom = "http://marklogic.com/cpf/domains" at "/MarkLogic/cpf/domains.xqy"; ' ||
435
+
'declare variable $m:pname as xs:string external;declare variable $m:pnames as xs:string* external;' ||
436
+
'declare variable $m:mdb as xs:unsignedLong external;'||
437
+
'declare variable $m:type as xs:string external;' ||
438
+
'declare variable $m:path as xs:string external;' ||
439
+
'declare variable $m:otherpipeline as xs:string external;' ||
440
+
'declare variable $m:depth as xs:string external;' ||
0 commit comments