Skip to content

Commit

Permalink
issue #156
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Jun 24, 2016
1 parent 9a89e54 commit 6508b91
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public EntityCollection getEvents(@PathParam("uniqueid") String uniqueid) {
* @param sortorder
*/
@GET
@Path("/worklistbyauthor/{user}")
@Path("/tasklist/author/{user}")
public EntityCollection getWorkListByAuthor(@PathParam("user") String user,
@DefaultValue("0") @QueryParam("start") int start, @DefaultValue("10") @QueryParam("count") int count,
@QueryParam("type") String type, @DefaultValue("0") @QueryParam("sortorder") int sortorder,
Expand All @@ -217,7 +217,7 @@ public EntityCollection getWorkListByAuthor(@PathParam("user") String user,


@GET
@Path("/worklistbycreator/{creator}")
@Path("/tasklist/creator/{creator}")
public EntityCollection getWorkListByCreator(@PathParam("creator") String creator,
@DefaultValue("0") @QueryParam("start") int start, @DefaultValue("10") @QueryParam("count") int count,
@QueryParam("type") String type, @DefaultValue("0") @QueryParam("sortorder") int sortorder,
Expand All @@ -243,7 +243,7 @@ public EntityCollection getWorkListByCreator(@PathParam("creator") String creato


@GET
@Path("/worklistbyprocessid/{processid}")
@Path("/tasklist/processid/{processid}")
public EntityCollection getWorkListByProcessID(@PathParam("processid") int processid,
@DefaultValue("0") @QueryParam("start") int start, @DefaultValue("10") @QueryParam("count") int count,
@QueryParam("type") String type, @DefaultValue("0") @QueryParam("sortorder") int sortorder,
Expand All @@ -260,7 +260,7 @@ public EntityCollection getWorkListByProcessID(@PathParam("processid") int proce


@GET
@Path("/worklistbygroup/{processgroup}")
@Path("/tasklist/group/{processgroup}")
public EntityCollection getWorkListByGroup(@PathParam("processgroup") String processgroup,
@DefaultValue("0") @QueryParam("start") int start, @DefaultValue("10") @QueryParam("count") int count,
@QueryParam("type") String type, @DefaultValue("0") @QueryParam("sortorder") int sortorder,
Expand All @@ -282,7 +282,7 @@ public EntityCollection getWorkListByGroup(@PathParam("processgroup") String pro


@GET
@Path("/worklistbyowner/{owner}")
@Path("/tasklist/owner/{owner}")
public EntityCollection getWorkListByOwner(@PathParam("owner") String owner,
@DefaultValue("0") @QueryParam("start") int start, @DefaultValue("10") @QueryParam("count") int count,
@QueryParam("type") String type, @DefaultValue("0") @QueryParam("sortorder") int sortorder,
Expand All @@ -306,20 +306,6 @@ public EntityCollection getWorkListByOwner(@PathParam("owner") String owner,



@GET
@Path("/worklistbywriteaccess")
public EntityCollection getWorkListByWriteAccess(@DefaultValue("0") @QueryParam("start") int start,
@DefaultValue("10") @QueryParam("count") int count, @QueryParam("type") String type,
@DefaultValue("0") @QueryParam("sortorder") int sortorder, @QueryParam("items") String items) {
Collection<ItemCollection> col = null;
try {
col = workflowService.getWorkListByWriteAccess(start, count, type, sortorder);
return XMLItemCollectionAdapter.putCollection(col, EntityRestService.getItemList(items));
} catch (Exception e) {
e.printStackTrace();
}
return new EntityCollection();
}

@GET
@Path("/worklistbyref/{uniqueid}")
Expand Down
53 changes: 30 additions & 23 deletions src/site/markdown/restapi/workflowservice.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,58 @@
#The Workflow Service
The main resource /workflow is uses to read Workitems and Workitem collections through the Imixs Rest Service Interface.
The Imixs-Workflow REST service interface provides different resources located under */workflow* to access and modifiy workitems.


## The /workflow GET resources
The /workflow resources are used to get the business objects provided by the Imixs Workflow Manager:
## GET Workitem Resource
The resource /workflow/workitem returns a single workitem or meta data:

| URI | Description |
|-----------------------------------------------|-------------------------------------------|
| /workflow/worklist/{user} | a collection of workitems representing the worklist by a specific user (or value 'null' for the current user)|
| /workflow/worklistbycreator/{creator} | a collection of workitems created by a specific user (or value 'null' for the current user) |
| /workflow/worklistbyprocessid/{processid} | a collection of workitems in a specific process state |
| /workflow/worklistbygroup/{processgroup} | a collection of workitems in a specific process group |
| /workflow/worklistbyowner/{owner} | a collection of workitems owned by a specific user (or value 'null' for the current user) |
| /workflow/worklistbywriteaccess | a collection of workitems where the current has a write access |
| /workflow/worklistbyref/{uniqueid} | a collection of workitems referenced to a specific uniqueid (childs) |
| /workflow/worklistbyquery/{query} | a collection of workitems specified by a JPQL phrase |
| /workflow/worklistcountbyquery/{query} | the count of workitems returned by a JPQL phrase |
| /workflow/workitem/{uniqueid} |a single workitem represented by the provided uniqueid |
| /workflow/workitem/{uniqueid} | a single workitem represented by the provided uniqueid |
| /workflow/workitem/{uniqueid}/file/{file} | a file attachment located in the property $file of the spcified workitem |


## The /worflow resources PUT and POST
The /workflow/xxxx PUT and POST resources URIs are used to write business objects:
## GET Task List Resources
The resource /workflow/tasklist/ returns collections of workitems:

| URI | Description |
|-----------------------------------------------|-------------------------------------------|
| /workflow/tasklist/{user} | a collection of workitems representing the worklist by a specific user (or value 'null' for the current user)|
| /workflow/tasklist/creator/{creator} | a collection of workitems created by a specific user (or value 'null' for the current user) |
| /workflow/tasklist/processid/{processid} | a collection of workitems in a specific process state |
| /workflow/tasklist/group/{processgroup} | a collection of workitems in a specific process group |
| /workflow/tasklist/owner/{owner} | a collection of workitems owned by a specific user (or value 'null' for the current user) |
| /workflow/tasklist/ref/{uniqueid} | a collection of workitems referenced to a specific uniqueid (childs) |
| /workflow/tasklist/query/{query} | a collection of workitems specified by a JPQL phrase |
| /workflow/tasklist/query/count/{query} | the count of workitems returned by a JPQL phrase |



## PUT/POST Workitem or Task List
The following resource URIs are used to PUT and POST a wokitem or a task list:


| URI | Description |
|------------------------------|-------------------------------------------|
| /workflow/workitem | posts a workitem to be processed by the workflow manager. The post data can be x-www-form-urlencoded or in xml format |
| /workflow/workitem/{uniqueid}| posts a workitem to be processed by the workflow manager. The post data can be x-www-form-urlencoded or in xml format |
| /workflow/worklist | posts a worklist to be processed by the workflow manager. The post data can be x-www-form-urlencoded or in xml format |
| /workflow/workitem.json | posts a workitem to be processed by the workflow manager. The post data is expected in json format. The result in json format |
| /workflow/workitem.json/{uniqueid} | posts a workitem to be processed by the workflow manager. The post data is expected in json format. The result in json format |
| /workflow/tasklist | posts a list of workitems to be processed by the workflow manager. The post data can be x-www-form-urlencoded or in xml format |



## Resource Options
You can specify additional URI parameters to filter the resultset or to navigate through a sub list of workitems. Append optional arguments to define the number of workitems returned by a URL, the starting point inside the list or the sort order. Combine any of the following arguments for the desired result.
Additional URI parameters can be used to filter the result set, or to navigate through a sub list of the result set.


| option | description | example |
|-------------|-----------------------------------------------------|-----------------------|
| count | number of workitems returned by a collection | ..?count=10 |
| start | position to start workitems returned by a collection | ..?start=5&count=10 |
| type | Optional type property workitems are filtered | ..?type=workitem |
| sortorder | defines the sortorder of the returned collection <br /> (0=creation date descending <br />,1=creation date ascending<br />,2=modified date descending<br />,3=modified date ascending) |&sortorder=2 |
| count | number of workitems to be returned by a collection | ..?count=10 |
| start | start position of a collection of workitems | ..?start=5&count=10 |
| type | filter workitems by the 'type' property | ..?type=workitem |
| sortorder | sortorder of the returned collection <br /> (0=creation date descending <br />,1=creation date ascending<br />,2=modified date descending<br />,3=modified date ascending) |&sortorder=2 |

<strong>Note:</strong> The Imixs JEE Workflow manages the access to workitems by individual access lists per each entity. So the result of a collection of workitems will only contain entities where the current user has a read access right. Without access the workitem will not be returned by the workflowManager and so it will not be included in the list.
<strong>Note:</strong> The Imixs-Workflow manages the access to workitems by individual access lists per each entity. The result of a collection of workitems depends on the current user accesslevel and read access permissions for a workitem. Read also the section [Access Control](/engine/acl.html) for further information.


0 comments on commit 6508b91

Please sign in to comment.