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

Commit 38512b2

Browse files
committed
Merge pull request #22 from adamfowleruk/feature-21
Feature 21 Completed (Alerting)
2 parents f45a2fe + 1420eab commit 38512b2

32 files changed

+472
-74
lines changed

CONTRIBUTING.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ your vision does not align with that of a project maintainer.
7373
#### Create a branch for your feature
7474

7575
Okay, so you have decided to add something. Create an issue on GitHub if you haven't already, as you'll need the ID.
76-
Now create a feature branch and start hacking:
76+
Now create a feature branch and start hacking. You can do this on your own fork, or the main site if a 'Contributor':
7777

7878
```sh
7979
$ git checkout -b feature-ISSUEID develop
@@ -93,7 +93,8 @@ To share the branch so others can see it (although advised not to work on it) do
9393
$ git push --set-upstream origin feature-ISSUEID
9494
```
9595

96-
Now your feature branch [will be visible on GitHub](https://github.com/adamfowleruk/marklogicworkflow/branches).
96+
Now your feature branch [will be visible on GitHub](https://github.com/adamfowleruk/marklogicworkflow/branches) if you
97+
are a contributor.
9798

9899
#### Formatting code
99100

@@ -119,16 +120,23 @@ Make sure that all tests pass. Please, do not submit patches that fail.
119120

120121
When the feature is complete and ready to be integrated back in to the develop branch:-
121122

123+
1. If on your own Fork (99% of people):-
122124
```sh
123125
$ git commit -m "Fixes #ISSUEID"
124126
$ git pull origin develop
125127
$ git checkout develop
126128
$ git merge feature-ISSUEID
127129
$ git push
128-
$ git branch -d feature-ISSUEID
129130
```
130131

131-
Only do the last command if the others complete successfully. You may have to merge conflicts.
132+
2. If an assigned admin user (contributor) on the main project, do this instead:-
133+
```sh
134+
$ git commit -m "Fixes #ISSUEID"
135+
$ git push
136+
```
137+
138+
Now issue a pull request for your changes to the main project.
139+
132140

133141
You're now done! Adding the 'Fixes #ISSUEID' comment to the last commit automatically closes the issue with a reference
134142
to your code.

data/restapi.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
{"name": "processinbox", "methods": ["GET"]},
77
{"name": "processqueue", "methods": ["GET"]},
88
{"name": "processmodel", "methods": ["GET","POST","PUT"]},
9-
{"name": "processsubscription", "methods": ["PUT"]}
9+
{"name": "processsubscription", "methods": ["PUT"]},
10+
{"name": "processsearch", "methods": ["PUT"]}
1011
],
1112
"transforms": [],
1213
"triggers": [

documentation/DEV-MODELER.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,39 @@ you access to everything you need.
2626
Until this happens, or if you need the very latest MarkLogic Workflow model element support whilst working on a new
2727
project, you will need to execute the extension manually.
2828

29-
To execute the latest extension:-
30-
- Checkout or download the zip of the latest (develop branch) of MarkLogic Workflow at http://github.com/adamfowleruk/marklogicworkflow
29+
### Latest from source (any branch) for Plugin development
30+
31+
Note: If following the Contributing guide, you should have logged an issue and created a new branch from develop using
32+
```sh
33+
$ git checkout -b feature-ISSUEID develop
34+
```
35+
36+
To execute the latest extension from source:-
37+
- Checkout or download the zip of the latest (develop or feature branch) of MarkLogic Workflow at http://github.com/adamfowleruk/marklogicworkflow
3138
- Open Eclipse Luna (4.4) or above
3239
- Go to File -> Import project
3340
- Navigate to ./marklogicworkflow/eclipse/org.eclipse.bpmn2.modeler.runtime.marklogic (NOT just ./marklogicworkflow)
3441
- Import this workspace
3542
- Double click on the 'plugin.xml' file
3643
- In the top right of the edit dialogue for this file, click the green Play button. This launches Eclipse Luna with this extension
44+
45+
### Current published In Development version
46+
47+
- In Eclipse Luna (4.4) or above, go to Help -> Install new software
48+
- In the update site field type https://raw.githubusercontent.com/adamfowleruk/marklogicworkflow/develop/eclipse/MarkLogicWorkflowUpdateSite
49+
- It will take a few seconds to download plugin information
50+
- Select the Eclipse BPMN2 Modeler - MarkLogic Workflow Runtime Extension Feature
51+
- Click Next
52+
- Follow the prompts
53+
- NOTE: If you are warned about the project not being signed, click on 'OK' and NOT 'Cancel' to proceed with installation
54+
- Restart Eclipse Luna
55+
56+
### Current published released version
57+
58+
- As for Current published in development version, except use this URL: https://raw.githubusercontent.com/adamfowleruk/marklogicworkflow/master/eclipse/MarkLogicWorkflowUpdateSite
59+
60+
## Creating a new Workflow process diagram
61+
3762
- Now go to File - Import or File - New Project to create your new modelling project
3863
- Right click the root folder and select New - Other
3964
- Open the 'BPMN2' category and select either 'MarkLogic CPF Process Diagram' or 'MarkLogic Workflow Process Diagram'
@@ -52,10 +77,16 @@ In the future MarkLogic Workflow will allow any arbitrary CPF pipeline to be exp
5277
modeler. This will allow for full round trip re-engineering of MarkLogic CPF processes.
5378

5479
*WARNING: It should be noted that CPF diagram support is very much an Alpha product and not scheduled to be fully
55-
implemented for a while.*
80+
implemented for a while.*
5681

5782
## Related information
5883

59-
For the custom runtime/task videos, see this first:-
84+
The best source for Eclipse extension tutorials is:-
85+
https://wiki.eclipse.org/BPMN2-Modeler/DeveloperTutorials
86+
87+
These have been updated for the latest Luna version of the Eclipse BPMN2 modeler
88+
89+
You may also find it instructive to download the 'jBPM Runtime Extension' project from the above project's GitHub site.
90+
I use this for many examples.
6091

61-
http://bobsbizbuzz.blogspot.it/2014/06/blog-post_10.html
92+
A developer forum is also available: https://www.eclipse.org/forums/index.php/f/226/

documentation/DEVELOPER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ Here is the developer documentation
22

33
- [Adding a new Activity type](DEV-NEWACTIVITY.md)
44
- [Creating a custom step processor](DEV-STEPPROC.md)
5-
- [Integrating your app to MarkLogic Workflow](./RESTAPI.md)
5+
- [Integrating your app to MarkLogic Workflow](RESTAPI.md)
66

77
Any issues contact me at [email protected]

documentation/MODELLING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ The Eclipse BPMN2 modeller is a good option, with support for pluggable runtime
1616
easy to define a MarkLogic runtime and set of custom tasks, and hide any BPMN2 tasks that we do not support the
1717
execution of.
1818

19+
To install the MarkLogic Workflow BPMN2 Eclipse modeler extension, see the [Modelling Development page](DEV-MODELER.md).
20+
1921
Also view the [BPMN2 specification summary document](bpmn2-spec.md)
2022

2123
Also take a look at the [Step documentation](STEPS.md) for information on individual steps and supported parameters.

documentation/RESTAPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
See also MODELLING.md for the REST API to install a MarkLogic workflow process model.
3+
See also the [Modelling Overview](MODELLING.md) for the REST API to install a MarkLogic workflow process model.
44

55

66
## How the workflow engine works

documentation/SPRINTS.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ steps if a duplicate is found. Requires search (by property hash AND not (same u
3434

3535
## Sprint 1 - Basic workflow
3636

37+
Completed Sat 18 Apr 2015 14:30 BST by Adam Fowler
38+
3739
- DONE BPMN2: generic blank task
3840
- DONE BPMN2: user task -> aka human step
3941
- 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
5052
- DONE Tools: Process Data model XSD (for modeler import)
5153
- DONE Tools: Eclipse BPMN 2 Modeler Palette and Process diagram support, including new diagram creation for MarkLogic
5254
- 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
5557
- DONE processmodel.xqy
5658
- DONE PUT create and publish process model, accepting BPMN2 content type .bpmn2, and to update process model without publishing
5759
- 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
6062
- DONE PUT create instance of a process (starts a process)
6163
- DONE POST complete a human task
6264
- 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)
6567
- DONE processinbox.xqy
6668
- DONE processqueue.xqy
6769
- TEST support for roles (processroleinbox.xqy) on user tasks (For BD)

documentation/USING-SUBSCRIPTIONS.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ The above is why I decided to have a process document that CPF runs against, rat
2121
## How it works
2222

2323
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
2626
4. CPF manages the state transitions and execution of BPMN2 CPF actions throughout the process lifecycle
2727
5. Process eventually completes (or fails), leaving the process document as an audit record of what happened, with metrics for performance analysis
2828

@@ -39,13 +39,19 @@ Several reasons.
3939
## Isn't it a bit convoluted?
4040

4141
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
4343
domain configuration, for you.
4444

4545
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
4747
in marklogic.
4848

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
5050
if starting a process via an ESB or application. A good example is starting a process to tell a person to create a
5151
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
57+
- Manual start: 06-payload.xml 06-process-create.sh

documentation/USING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ This section of the documentation is very much a work in progress. See the [REST
77
details right now.
88

99
- [Creating a Process Subscription](USING-SUBSCRIPTIONS.md)
10-
- Starting a process without a content document
10+
- Starting a process without a content document - see the above link, last paragraph

modules/app/models/alert-action-process.xqy

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ declare variable $alert:action as element(alert:action) external;
2121
(: Create a process instance for this document :)
2222

2323
(: Find appropriate process from alert action option :)
24-
let $procname := $alert-action/alert:options/wf:process-name/text()
25-
return
26-
wfu:create($procname,$alert:doc/element(),
27-
<attachment name="InitiatingAttachment" cardinality="1">
28-
<uri>{fn:base-uri($alert:doc)}</uri>
29-
</attachment>
24+
let $procname := xs:string($alert:action/alert:options/wf:process-name)
25+
let $pid := wfu:create($procname,$alert:doc/element(),
26+
(<wf:attachment name="InitiatingAttachment" uri="{fn:base-uri($alert:doc)}" cardinality="1"/>)
3027
)
28+
return ()
29+
3130

3231
(:)
3332
xdmp:document-insert($procname || "/" || sem:uuid-string() || ".xml",

0 commit comments

Comments
 (0)