Skip to content

Commit

Permalink
added method getEvent, updated docu (#891)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Jan 5, 2025
1 parent f510cb8 commit 5e047b0
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
11 changes: 10 additions & 1 deletion src/site/markdown/restapi/modelservice.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5e047b0

Please sign in to comment.