// 为任务创建变量
taskService.setVariable(taskInstance.getId(), "变量", "变量值");
//创建任务查询
TaskQuery taskQuery = taskService.createTaskQuery();
//查询变量等于“变量”的任务实例
List<TaskInstance> taskInstances = taskQuery.variableData("变量", false).list();
assertEquals(0, taskInstances.size());
taskQuery = taskService.createTaskQuery();
taskInstances = taskQuery.variableData("变量", true).list();
assertEquals(0, taskInstances.size());