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 Sep 8, 2020. It is now read-only.
@@ -4,20 +4,20 @@ Restful web API for InterSystems Ensemble Workflow
4
4
5
5
## Installation
6
6
1. Import and compile this project.
7
-
2. Create a web-application for REST in the Portal Management System (for ex. /csp/workflow/rest). Set dispatch class to Workflow.REST, Authentication methods to 'Unauthorized' and 'Password'.
8
-
3. (Optional) add Workflow package mapping if you need to query another namespace.
7
+
2. Create a web-application for REST in the Portal Management System (for ex. `/csp/workflow/rest`). Set dispatch class to `Workflow.REST`, Authentication methods to 'Unauthorized' and 'Password'.
8
+
3. (Optional) Add Workflow package mapping if you need to query another namespace.
9
9
10
10
11
11
##Requests
12
12
13
13
These are the possible requests to web application (add param `?Namespace={Desired Namespace}` to query another namespace):
14
14
15
-
| URL | Type |Body (JSON) |Response | Description |
@@ -91,3 +90,160 @@ Here we can see two tasks, fist assigned to a current user (user4) and second on
91
90
| TimeCreated | Creation time | UTC timestamp |
92
91
| Age | Age of this item ||
93
92
| UserName | Current workflow user (EnsLib.Workflow.UserDefinition) | Current user |
93
+
94
+
## GET tasks/:id
95
+
96
+
After you received main information about available tasks, you can see it in more detail, by requesting it by id (`345||dev` in example). Here's how response object looks like:
97
+
98
+
```
99
+
{
100
+
"_class":"EnsLib.Workflow.Worklist",
101
+
"_id":"345||dev",
102
+
"Task": {
103
+
"_class":"EnsLib.Workflow.TaskResponse",
104
+
"_id":345,
105
+
"%Action":"",
106
+
"%Priority":3,
107
+
"%UserName":"",
108
+
"%UserTitle":"",
109
+
"%UserRanking":"",
110
+
"%RoleName":"Demo-Development",
111
+
"%Subject":"Problem reported by TestUser",
112
+
"%Message":"SampleTask",
113
+
"%Actions":"Corrected,Ignored",
114
+
"%FormTemplate":"",
115
+
"%FormFields":"Comments",
116
+
"%FormValues": {},
117
+
"%Status":"Assigned",
118
+
"%TaskStatus": {
119
+
"_class":"EnsLib.Workflow.TaskStatus",
120
+
"Role": {
121
+
"_class":"EnsLib.Workflow.RoleDefinition",
122
+
"_id":"Demo-Development",
123
+
"Name":"Demo-Development",
124
+
"Description":"",
125
+
"Capacity":100
126
+
},
127
+
"AssignedTo":"dev",
128
+
"TimeCreated":"2015-03-04 13:27:39.917",
129
+
"TimeCompleted":"",
130
+
"SessionId":291,
131
+
"Source":"HelpDesk",
132
+
"ResponseToken":"323|Demo.Workflow.Production",
133
+
"IsComplete":false,
134
+
"Request": {
135
+
"_class":"EnsLib.Workflow.TaskRequest",
136
+
"_id":344,
137
+
"%Actions":"Corrected,Ignored",
138
+
"%Subject":"Problem reported by TestUser",
139
+
"%Message":"SampleTask",
140
+
"%Priority":3,
141
+
"%UserName":"",
142
+
"%Title":"",
143
+
"%TaskHandler":"",
144
+
"%Command":"",
145
+
"%FormTemplate":"",
146
+
"%FormFields":"Comments",
147
+
"%FormValues": {}
148
+
}
149
+
}
150
+
},
151
+
"User": {
152
+
"_class":"EnsLib.Workflow.UserDefinition",
153
+
"_id":"dev",
154
+
"Name":"dev",
155
+
"FullName":"",
156
+
"IsActive":true
157
+
},
158
+
"Role":null,
159
+
"TimeCreated":"2016-12-04 14:30:35.647",
160
+
"IsNew":false,
161
+
"Age":"00w 3d 23h 34m 48s"
162
+
}
163
+
```
164
+
165
+
It's just a json representation of [EnsLib.Workflow.Worklist](http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=ENSLIB&CLASSNAME=EnsLib.Workflow.Worklist) object.
166
+
This request provides enouth information to display task to the user.
167
+
168
+
## POST tasks/:id
169
+
170
+
After user is done working on his task, you need to notify Workflow engine about new state of the task. To do thet, execute this request, with the json representation of EnsLib.Workflow.Worklist object (received from the previous request) as a body.
171
+
To express changes made by user, modify EnsLib.Workflow.Worklist object:
172
+
173
+
- Set `Task.%Action` property to one of %Actions values or `$Accept` to accept task, `$Relinquish` to relinquish task and `$Save` to save changes made to task
174
+
- Provide `Task.%FormValues` as an array with kays from `%FormFields` and values provided from a client
175
+
176
+
Here's an example of user completing `345||dev` task (by choosing Corrected action):
0 commit comments