1. 程式人生 > >Activiti 報錯 A delegated task cannot be completed, but should be resolved instead

Activiti 報錯 A delegated task cannot be completed, but should be resolved instead

在使用Activiti進行委託任務時,委託任務完成後,被委託人完成任務報錯:

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

原因是被委託的流程需要先resolved這個任務再提交。
所以在complete之前需要先resolved

// 被委派人處理完成任務
taskService.resolveTask(taskId,variables);
// 提交使用者任務表單並完成任務
taskService.complete(taskId, variables);