String processInstanceId = processInstance.getId();
String processDefinitionId = processDefinition.getId();
DbSqlSession dbSqlSession = commandContext.getDbSqlSession();
// 操作Task表
TaskEntityManager taskEntityManager = commandContext
.getTaskEntityManager();
List<TaskEntity> tasks = taskEntityManager
.findTasksByProcessInstanceId(processInstanceId);
for (TaskEntity taskEntity : tasks) {
taskEntity.setProcessDefinitionId(processDefinitionId);
taskEntity.update();