AdvanceCaseRuntimeDataServiceImpl extends AbstractAdvanceRuntimeDataServiceImpl implements AdvanceCaseRuntimeDataService { @Override public List<org.jbpm.services.api.model.UserTaskInstanceWithPotOwnerDesc> queryUserTasksByVariables(List<QueryParam> attributes, List<QueryParam> taskVariables, List<QueryParam> caseVariables, List<String> owners, QueryContext queryContext) { return queryUserTasksByVariables(translate(translateTable, attributes), caseVariables, taskVariables, owners, CASE_TYPE, CASE_FILE_PREFIX, queryContext); } AdvanceCaseRuntimeDataServiceImpl(); @Override List<org.jbpm.services.api.model.ProcessInstanceWithVarsDesc> queryCaseByVariables(List<QueryParam> attributes,
                                                                                              List<QueryParam> caseVariables,
                                                                                              QueryContext queryContext); @Override List<org.jbpm.services.api.model.ProcessInstanceWithVarsDesc> queryCaseByVariablesAndTask(List<QueryParam> attributes,
                                                                                                     List<QueryParam> taskVariables,
                                                                                                     List<QueryParam> caseVariables,
                                                                                                     List<String> owners,
                                                                                                     QueryContext queryContext); @Override List<org.jbpm.services.api.model.UserTaskInstanceWithPotOwnerDesc> queryUserTasksByVariables(List<QueryParam> attributes,
                                                                                                        List<QueryParam> taskVariables,
                                                                                                        List<QueryParam> caseVariables,
                                                                                                        List<String> owners,
                                                                                                        QueryContext queryContext);  }
@Test public void testSearchUserByVariable() { Map<String, OrganizationalEntity> roleAssignments = new HashMap<>(); roleAssignments.put("owner", new UserImpl(USER)); Map<String, Object> data = new HashMap<>(); data.put("name", "my first case"); CaseFileInstance caseFile = caseService.newCaseFileInstance(deploymentUnit.getIdentifier(), USER_TASK_CASE_P_ID, data, roleAssignments); String caseId = caseService.startCase(deploymentUnit.getIdentifier(), USER_TASK_CASE_P_ID, caseFile); List<UserTaskInstanceWithPotOwnerDesc> process = advanceCaseRuntimeDataService.queryUserTasksByVariables(emptyList(), emptyList(), emptyList(), emptyList(), new QueryContext()); assertEquals(1, process.size()); assertEquals("my first case", process.get(0).getExtraData().get("name")); assertNotNull(caseId); assertEquals(HR_CASE_ID, caseId); caseService.cancelCase(caseId); }