public virtual CommentDto createComment(UriInfo uriInfo, CommentDto commentDto) { ensureHistoryEnabled(Status.FORBIDDEN); ensureTaskExists(Status.BAD_REQUEST); Comment comment; try { comment = engine.TaskService.createComment(taskId, null, commentDto.Message); } catch (ProcessEngineException e) { throw new InvalidRequestException(Status.BAD_REQUEST, e, "Not enough parameters submitted"); } URI uri = uriInfo.BaseUriBuilder.path(rootResourcePath).path(org.camunda.bpm.engine.rest.TaskRestService_Fields.PATH).path(taskId + "/comment/" + comment.Id).build(); CommentDto resultDto = CommentDto.fromComment(comment); // GET / resultDto.addReflexiveLink(uri, HttpMethod.GET, "self"); return(resultDto); }