diff --git a/imixs-workflow-jax-rs/src/main/java/org/imixs/workflow/jaxrs/WorkflowRestService.java b/imixs-workflow-jax-rs/src/main/java/org/imixs/workflow/jaxrs/WorkflowRestService.java index a60225090..2425ade2e 100644 --- a/imixs-workflow-jax-rs/src/main/java/org/imixs/workflow/jaxrs/WorkflowRestService.java +++ b/imixs-workflow-jax-rs/src/main/java/org/imixs/workflow/jaxrs/WorkflowRestService.java @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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 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}") diff --git a/src/site/markdown/restapi/workflowservice.md b/src/site/markdown/restapi/workflowservice.md index d1c4cca06..d06b46c51 100644 --- a/src/site/markdown/restapi/workflowservice.md +++ b/src/site/markdown/restapi/workflowservice.md @@ -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
(0=creation date descending
,1=creation date ascending
,2=modified date descending
,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
(0=creation date descending
,1=creation date ascending
,2=modified date descending
,3=modified date ascending) |&sortorder=2 | -Note: 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. +Note: 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. \ No newline at end of file