工作流解决历史批注中文乱码"/>
activiti工作流解决历史批注中文乱码
时间:2020-03-19
本文章向大家介绍activiti工作流解决历史批注中文乱码,主要包括activiti工作流解决历史批注中文乱码使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
/**
- 根据流程实例查询流程的批注信息
- @param processInstanceId
- @return
*/
private List findCommentByProcessInstanceId(String processInstanceId) {
return taskService.getProcessInstanceComments(processInstanceId);
}
默认获取到的Comment是没有getMessage()方法的,只有getFullMessage(),getFullMessage会跟随部署的系统编码,保存到数据库中的bolb字段可能会出现乱码,但是message字段不是乱码,如果审批备注只是文字的话,可以直接取message字段的值。
查看源码得知,CommentEntityImpl 实现了Comment类接口,既可以把Comment 转换为CommentEntityImpl,直接用其中的getMessage()方法即可。
List list = findCommentByProcessInstanceId(processInstanceId);
for (Comment commentEntity : list) {
CommentEntityImpl comment = null;
if(commentEntity instanceof CommentEntityImpl){
comment = (CommentEntityImpl)commentEntity;
}
String message = comment.getMessage();
更多推荐
activiti工作流解决历史批注中文乱码
发布评论