Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 74cbf3b

Browse files
authored
Docs
1 parent 7607ce9 commit 74cbf3b

File tree

1 file changed

+76
-4
lines changed

1 file changed

+76
-4
lines changed

README.md

Lines changed: 76 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,89 @@ Restful web API for InterSystems Ensemble Workflow
55
## Installation
66
1. Import and compile this project.
77
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 packagfe mapping if you need to query another namespace.
8+
3. (Optional) add Workflow package mapping if you need to query another namespace.
99

1010

1111
##Requests
1212

13-
These are the possible requests to web application (add param ?Namespace={Desired Namespace} to query another namespace cubes):
13+
These are the possible requests to web application (add param `?Namespace={Desired Namespace}` to query another namespace):
1414

1515
| URL | Type | Body (JSON) | Response | Description |
1616
|-----------------------------|------|-----------------------------|-----------|--------------------------------|
17-
| login | POST | { "Username":"CacheUser","Password":"CachePassword" }| JSON| Current user|
18-
| tasks | GET | | JSON | Unassigned tasks or assigned to current user |
17+
| tasks | GET | | JSON | Get unassigned tasks or tasks assigned to current user |
1918
| tasks/:id | GET | | JSON | EnsLib.Workflow.Worklist object|
2019
| tasks/:id | POST |{EnsLib.Workflow.Worklist object}|JSON | Processing of modified object |
2120
| test | GET | | JSON | Test info |
21+
22+
23+
## Prerequisites
24+
25+
If you work with Ensemble Workflow it is recommended to familiaze yourself with [EnsLib.Workflow](http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=ENSLIB&PACKAGE=1&CLASSNAME=EnsLib.Workflow) package. Here's quick primer on the main classes:
26+
27+
| Class | Description |
28+
|----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
29+
| EnsLib.Workflow.ActionDefinition | Defines the set of available actions that a user can make within a Workflow application. Users can extend this list. |
30+
| EnsLib.Workflow.Engine | Provides the core APIs for the Ensemble Workflow system. |
31+
| EnsLib.Workflow.FormEngine | Provides the API for managing form associated with Workflow tasks. |
32+
| EnsLib.Workflow.Operation | This Business Operation manages the delegation of workflow tasks to the Ensemble Workflow Engine. |
33+
| EnsLib.Workflow.RoleDefinition | Defines a workflow role and its members. |
34+
| EnsLib.Workflow.RoleMembership | Manages the many-to-many relationship of workflow Users and Roles. Each instance represents the association of a specific User with a specific Role. |
35+
| EnsLib.Workflow.TaskRequest | A task is a specialized request for a user action (it is used as part of a Workflow application). |
36+
| EnsLib.Workflow.TaskResponse | Response from a Workflow Task request. The Workflow Engine creates an instance of TaskResponse object as soon it receives a TaskRequest. This object is used to maintain the status of the task while it is under the control of the Workflow Engine. It also serves as the final response returned by the Workflow Engine when the task is complete.|
37+
| EnsLib.Workflow.TaskStatus | Holds Task Status details used by Workflow Engine to manage tasks. |
38+
| EnsLib.Workflow.UserDefinition | Defines a workflow user. Typically the user name matches a system user name but this is not required. Workflow users that are not registered system users will not be able to log into the Workflow portal and check the status of their worklist. |
39+
| EnsLib.Workflow.Worklist | Represents a worklist item associated with a User within a Workflow application. |
40+
41+
42+
## GET tasks
43+
44+
It's the basic and first requst you need to execute after logging in (by authentication method you configured for REST web application). It returns basic information unassigned tasks or tasks assigned to current user, here's how it looks like:
45+
46+
```
47+
{
48+
"children":[
49+
{
50+
"ID":"383015||user4",
51+
"New":"",
52+
"Priority":3,
53+
"Subject":"Task subject",
54+
"Message":"some additional message",
55+
"TaskId":383015,
56+
"RoleName":"Role",
57+
"AssignedTo":"user4",
58+
"TimeCreated":"2016-12-07 22:09:03.599",
59+
"Age":"00w 0d 16h 32m 30s",
60+
"UserName":"user4"
61+
},
62+
{
63+
"ID":"383011||user4",
64+
"New":"*",
65+
"Priority":1,
66+
"Subject":"Task subject",
67+
"Message":"some additional message",
68+
"TaskId":383011,
69+
"RoleName":"Role",
70+
"AssignedTo":"",
71+
"TimeCreated":"2016-12-07 20:43:21.627",
72+
"Age":"00w 0d 17h 58m 12s",
73+
"UserName":"user4"
74+
}
75+
],
76+
"total":2
77+
}
78+
```
79+
Here we can see two tasks, fist assigned to a current user (user4) and second one unassigned to the user. Object properties are
80+
81+
| Property | Description | Value |
82+
|-------------|------------------------------------------------------------------------------------|--------------------------------------------------------|
83+
| ID | Id of this EnsLib.Workflow.Worklist | |
84+
| New | Has the user seen this item yet? | * for no (new, never seen), "" for yes (not new, seen) |
85+
| Priority | Priority of the requested Task | 1 is highest |
86+
| Subject | Short summary of this task | |
87+
| Message | Detailed message body for this task | First 25 symbols only |
88+
| TaskId | Id of EnsLib.Workflow.TaskResponse object | |
89+
| RoleName | The workflow role (EnsLib.Workflow.RoleDefinition) | |
90+
| AssignedTo | Name of the user that has currently has ownership of the associated task (if any). | Either current user or no one |
91+
| TimeCreated | Creation time | UTC timestamp |
92+
| Age | Age of this item | |
93+
| UserName | Current workflow user (EnsLib.Workflow.UserDefinition) | Current user |

0 commit comments

Comments
 (0)