activiti办理出错

activiti5.22.0,办理任务时出错,

taskService.complete(taskId);

错误信息:

[11-21 14:45:52] ERROR CommandContext [main]: Error while closing command context

org.activiti.engine.ActivitiException: A delegated task cannot be completed, but should be resolved instead.


在使用Activiti进行委托任务时,委托任务完成后,被委托人完成任务报错:

A delegated task cannot be completed, but should be resolved instead.
  • 1

原因是被委托的流程需要先resolved这个任务再提交。 
所以在complete之前需要先resolved

// 被委派人处理完成任务
taskService.resolveTask(taskId,variables);
// 提交用户任务表单并完成任务
taskService.complete(taskId, variables);

连接:http://blog.csdn.net/chenfengdejuanlian/article/details/77450573

你可能感兴趣的:(Activiti,error)