diff --git a/imixs-workflow-jax-rs/src/main/java/org/imixs/workflow/jaxrs/ModelRestService.java b/imixs-workflow-jax-rs/src/main/java/org/imixs/workflow/jaxrs/ModelRestService.java index 52b140944..4df17c6dc 100644 --- a/imixs-workflow-jax-rs/src/main/java/org/imixs/workflow/jaxrs/ModelRestService.java +++ b/imixs-workflow-jax-rs/src/main/java/org/imixs/workflow/jaxrs/ModelRestService.java @@ -269,6 +269,15 @@ public Response getDefiniton(@PathParam("version") String version, @QueryParam(" return documentRestService.convertResult(definition, items, format); } + /** + * Returns the Task BPMN element by its ID and VersionID. + * + * @param version + * @param taskID + * @param items + * @param format + * @return + */ @GET @Path("/{version}/tasks/{taskid}") public Response getTask(@PathParam("version") String version, @PathParam("taskid") int taskID, @@ -283,6 +292,31 @@ public Response getTask(@PathParam("version") String version, @PathParam("taskid return documentRestService.convertResult(task, items, format); } + /** + * Returns the Task BPMN element by its ID and VersionID. + * + * @param version + * @param taskID + * @param items + * @param format + * @return + */ + @GET + @Path("/{version}/tasks/{taskid}/events/{eventid}") + public Response getEvent(@PathParam("version") String version, + @PathParam("taskid") int taskID, + @PathParam("eventid") int eventID, + @QueryParam("items") String items, @QueryParam("format") String format) { + ItemCollection event = null; + try { + BPMNModel model = modelService.getModelManager().getModel(version); + event = modelService.getModelManager().findEventByID(model, taskID, eventID); + } catch (Exception e) { + throw new WebApplicationException("BPMN Model Error: ", e); + } + return documentRestService.convertResult(event, items, format); + } + @GET @Path("/{version}/tasks/{taskid}/events") public Response findAllEventsByTask(@PathParam("version") String version, @PathParam("taskid") int taskID, diff --git a/src/site/markdown/restapi/modelservice.md b/src/site/markdown/restapi/modelservice.md index 6f5f15436..30e767730 100644 --- a/src/site/markdown/restapi/modelservice.md +++ b/src/site/markdown/restapi/modelservice.md @@ -13,12 +13,21 @@ The GET method is used to read model objects provided by the Model Manager: | /model | GET | a list of model versions provided by the workflow instance | | /model/{version}/tasks | GET | all tasks of a specific model version | | /model/{version}/tasks/{taskid} | GET | a task identified by its taskID | -| /model/{version}/tasks/{taskid}/events | GET | all events assigned to a specific task identified by its eventID. | +| /model/{version}/tasks/{taskid}/events | GET | all events assigned to a specific task. | +| /model/{version}/tasks/{taskid}/events/{eventid} | GET | a event assigned to a specific task identified by its eventID. | | /model/{version}/groups | GET | a collection of all workflow groups | | /model/{version}/groups/{group} | GET | all tasks of a specific workflow group | | /model/{version}/definition | GET | the model definition containing general model information (e.g.$ModelVersion, Actors, Plugins, ...). | | /model/{version}/bpmn | GET | BPMN source file | +| /model/{version}/tasks/{taskid}/dataobjects/{name} | GET | the content of a dataObject by name assigned to a BPMN task | +| /model/{version}/tasks/{taskid}/events/{eventid}/dataobject/{name} | GET | the content of a dataObject by name assigned to a BPMN event | +| /model/{version}/tasks/{taskid}/formdefinition | GET | the form definition assigned to a BPMN task | +**DataObjects** + +BPMN DataObjects assigned to a Task or an Event element are stored in the item `dataobjects` and can be requested by the corresponding element. See the following example to request all dataObjects assigned to task 1000 of the model 1.0 + +http://localhost:8080/api/model/1.0/tasks/1000?format=xml&items=dataobjects ## PUT/POST a Model The methods PUT and POST are used to write and update a model: