Authentication.setAuthenticatedUserId(UserContext.get().getName());
taskService.addComment(taskId, null, comment);
taskService.complete(taskId,vars);
@Override
public List<Comment> getComment(String taskId) {
String processInstanceId = taskService.createTaskQuery().taskId(taskId).singleResult().getProcessInstanceId();
List<Comment> commentList = taskService.getProcessInstanceComments(processInstanceId);
return commentList;
}
public List<CommontVo> commontTask(Map<String, Object> param) {
Object instanceId = param.get("processInstanceId");
List<CommontVo> cList = new ArrayList<>();
List<Comment> comments = taskService.getProcessInstanceComments(instanceId.toString());
for (Comment itm :
comments) {
CommontVo vo = new CommontVo();
vo.setId(itm.getId());
vo.setMessage(itm.getFullMessage());
vo.setCtime(itm.getTime());
vo.setTaskId(itm.getTaskId());
vo.setUserId(itm.getUserId());
vo.setProcessInstanceId(itm.getProcessInstanceId());
cList.add(vo);
}
return null;
}