*/ public List<TaskFormResoponse> taskFormResoponses(FormService formService,TaskService taskService,String assignee) { TaskFormResoponse taskForm=null; List<TaskFormResoponse> listTaskForm=new ArrayList<TaskFormResoponse>(); List<Task> listTask=taskService.createTaskQuery().taskAssignee(assignee).list(); logger.info("listTasktostring: "+listTask.toString()); logger.info("listTask: "+listTask.size()); //taskService.createTaskQuery().orderByTaskId().list(); for(Task task:listTask){ taskForm=new TaskFormResoponse(); taskForm.setFormDate(formService.getTaskFormData(task.getId())); taskForm.setTask(task); logger.info("task: "+task.toString()); logger.info("form: "+formService.getTaskFormData(task.getId())); listTaskForm.add(taskForm); } return listTaskForm; }
{"message":"Bad request","exception":"Could not write content: lazy loading outside command context (through reference chain: java.util.ArrayList[0]- >org.activiti.rest.service.api.rewrite_yadong.TaskFormResoponse[\"task\"]->org.activiti .engine.impl.persistence.entity.TaskEntity[\"variableInstances\"]); nested except ion is com.fasterxml.jackson.databind.JsonMappingException: lazy loading outside command context (through reference chain: java.util.ArrayList[0]->org.activiti.rest.service.api .rewrite_yadong.TaskFormResoponse[\"task\"]->org.activiti.engine.impl.persistence.entity. TaskEntity[\"variableInstances\"])"}
这个原生的Task是接口类型
直接拿来转json是有问题的,一般把task里的信息转进自己封装的业务实体里
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。