Source:
<code>public void testQueryProcessesByVariables() throws Exception { Assume.assumeTrue(configuration.isRest()); <START> Map<String, Object> parameters = new HashMap<String, Object>(); <END> parameters.put("stringData", "waiting for signal"); parameters.put("personData", createPersonInstance(USER_JOHN)); Long processInstanceId = processClient.startProcess(CONTAINER_ID, PROCESS_ID_USERTASK, parameters); try { List<TaskSummary> tasks = taskClient.findTasksByStatusByProcessInstanceId(processInstanceId, null, 0, 10); assertNotNull(tasks); assertEquals(1, tasks.size()); tasks = taskClient.findTasksAssignedAsPotentialOwner(USER_YODA, "First%", null, 0, 10); assertNotNull(tasks); assertEquals(1, tasks.size()); tasks = taskClient.findTasksAssignedAsPotentialOwner(USER_YODA, "First%", null, 0, 10, "Status", false); assertNotNull(tasks); assertEquals(1, tasks.size()); SearchQueryFilterSpec spec = new SearchQueryFilterSpec(); spec.setAttributesQueryParams(list(equalsTo("PROCESS_DEPLOYMENT_ID", CONTAINER_ID))); List<ProcessInstanceCustomVars> listProcesses = queryClient.queryProcessesByVariables(spec, 0, 2); assertNotNull(listProcesses); listProcesses.stream().forEach(e -> assertEquals(CONTAINER_ID, e.getContainerId())); spec = new SearchQueryFilterSpec(); spec.setAttributesQueryParams(list(in("PROCESS_DEFINITION_ID", PROCESS_ID_USERTASK))); List<ProcessInstanceUserTaskWithVariables> listTasks = queryClient.queryUserTaskByVariables(spec, 0, 2); assertNotNull(listTasks); listTasks.stream().forEach(e -> assertEquals(PROCESS_ID_USERTASK, e.getProcessDefinitionId())); } finally { processClient.abortProcessInstance(CONTAINER_ID, processInstanceId); } }</code><technical_language>need throw Exception - thrown in this method</technical_language>

Target:
public void testQueryProcessesByVariables() throws Exception { Assume.assumeTrue(configuration.isRest()); Map<String, Object> parameters = new HashMap<>(); parameters.put("stringData", "waiting for signal"); parameters.put("personData", createPersonInstance(USER_JOHN)); Long processInstanceId = processClient.startProcess(CONTAINER_ID, PROCESS_ID_USERTASK, parameters); try { List<TaskSummary> tasks = taskClient.findTasksByStatusByProcessInstanceId(processInstanceId, null, 0, 10); assertNotNull(tasks); assertEquals(1, tasks.size()); tasks = taskClient.findTasksAssignedAsPotentialOwner(USER_YODA, "First%", null, 0, 10); assertNotNull(tasks); assertEquals(1, tasks.size()); tasks = taskClient.findTasksAssignedAsPotentialOwner(USER_YODA, "First%", null, 0, 10, "Status", false); assertNotNull(tasks); assertEquals(1, tasks.size()); SearchQueryFilterSpec spec = new SearchQueryFilterSpec(); spec.setAttributesQueryParams(list(equalsTo(PROCESS_ATTR_DEPLOYMENT_ID, CONTAINER_ID))); List<ProcessInstanceCustomVars> listProcesses = queryClient.queryProcessesByVariables(spec, 0, 2); assertNotNull(listProcesses); listProcesses.stream().forEach(e -> assertEquals(CONTAINER_ID, e.getContainerId())); spec = new SearchQueryFilterSpec(); spec.setAttributesQueryParams(list(in(PROCESS_ATTR_DEFINITION_ID, PROCESS_ID_USERTASK))); List<ProcessInstanceUserTaskWithVariables> listTasks = queryClient.queryUserTaskByVariables(spec, 0, 2); assertNotNull(listTasks); listTasks.stream().forEach(e -> assertEquals(PROCESS_ID_USERTASK, e.getProcessDefinitionId())); } finally { processClient.abortProcessInstance(CONTAINER_ID, processInstanceId); } }