use of com.evolveum.midpoint.xml.ns._public.common.common_3.CaseWorkItemType.F_ASSIGNEE_REF in project midpoint by Evolveum.
the class QueryInterpreter2Test method test735QueryCertCaseReviewerAndEnabled.
@Test
public void test735QueryCertCaseReviewerAndEnabled() throws Exception {
Session session = open();
try {
PrismReferenceValue assigneeRef = ObjectTypeUtil.createObjectRef("1234567890", ObjectTypes.USER).asReferenceValue();
ObjectQuery query = QueryBuilder.queryFor(AccessCertificationCaseType.class, prismContext).item(F_WORK_ITEM, F_ASSIGNEE_REF).ref(assigneeRef).and().item(AccessCertificationCaseType.F_STAGE_NUMBER).eq().item(T_PARENT, AccessCertificationCampaignType.F_STAGE_NUMBER).build();
String real = getInterpretedQuery2(session, AccessCertificationCaseType.class, query, false);
String expected = "select\n" + " a.ownerOid, a.id, a.fullObject\n" + "from\n" + " RAccessCertificationCase a\n" + " left join a.workItems w\n" + " left join w.assigneeRef a2\n" + " left join a.owner o\n" + "where\n" + " (\n" + " (\n" + " a2.targetOid = :targetOid and\n" + " a2.relation in (:relation) and\n" + " a2.type = :type\n" + " ) and\n" + " (\n" + " a.stageNumber = o.stageNumber or\n" + " (\n" + " a.stageNumber is null and\n" + " o.stageNumber is null\n" + " )\n" + " )\n" + " )\n";
assertEqualsIgnoreWhitespace(expected, real);
} finally {
close(session);
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.CaseWorkItemType.F_ASSIGNEE_REF in project midpoint by Evolveum.
the class QueryInterpreterTest method test234QueryCertCaseReviewerAndEnabledByRequestedDesc.
@Test
public void test234QueryCertCaseReviewerAndEnabledByRequestedDesc() throws Exception {
Session session = open();
try {
PrismReferenceValue assigneeRef = ObjectTypeUtil.createObjectRef("1234567890", ObjectTypes.USER).asReferenceValue();
ObjectQuery query = prismContext.queryFor(AccessCertificationCaseType.class).item(F_WORK_ITEM, F_ASSIGNEE_REF).ref(assigneeRef).and().item(AccessCertificationCaseType.F_STAGE_NUMBER).eq().item(T_PARENT, AccessCertificationCampaignType.F_STAGE_NUMBER).and().item(T_PARENT, F_STATE).eq(IN_REVIEW_STAGE).desc(F_CURRENT_STAGE_CREATE_TIMESTAMP).build();
String real = getInterpretedQuery(session, AccessCertificationCaseType.class, query, false);
assertThat(real).isEqualToIgnoringWhitespace("select\n" + " a.ownerOid, a.id, a.fullObject\n" + "from\n" + " RAccessCertificationCase a\n" + " left join a.workItems w\n" + " left join w.assigneeRef a2\n" + " left join a.owner o\n" + "where\n" + " (\n" + " (\n" + " a2.targetOid = :targetOid and\n" + " a2.relation in (:relation) and\n" + " a2.targetType = :targetType\n" + " ) and\n" + " (\n" + " a.stageNumber = o.stageNumber or\n" + " (\n" + " a.stageNumber is null and\n" + " o.stageNumber is null\n" + " )\n" + " ) and\n" + " o.state = :state\n" + " )\n" + "order by a.reviewRequestedTimestamp desc");
} finally {
close(session);
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.CaseWorkItemType.F_ASSIGNEE_REF in project midpoint by Evolveum.
the class QueryInterpreterTest method test210QueryCertCaseReviewer.
@Test
public void test210QueryCertCaseReviewer() throws Exception {
Session session = open();
try {
ObjectQuery query = prismContext.queryFor(AccessCertificationCaseType.class).item(F_WORK_ITEM, F_ASSIGNEE_REF).ref("1234567890").build();
String real = getInterpretedQuery(session, AccessCertificationCaseType.class, query, false);
assertThat(real).isEqualToIgnoringWhitespace("select\n" + " a.ownerOid, a.id, a.fullObject\n" + "from\n" + " RAccessCertificationCase a\n" + " left join a.workItems w\n" + " left join w.assigneeRef a2\n" + "where\n" + " (\n" + " a2.targetOid = :targetOid and\n" + " a2.relation in (:relation)\n" + " )\n");
} finally {
close(session);
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.CaseWorkItemType.F_ASSIGNEE_REF in project midpoint by Evolveum.
the class QueryInterpreterTest method test230QueryCertCaseReviewerAndEnabledByDeadlineAndOidAsc.
@Test
public void test230QueryCertCaseReviewerAndEnabledByDeadlineAndOidAsc() throws Exception {
Session session = open();
try {
PrismReferenceValue assigneeRef = ObjectTypeUtil.createObjectRef("1234567890", ObjectTypes.USER).asReferenceValue();
ObjectQuery query = prismContext.queryFor(AccessCertificationCaseType.class).item(F_WORK_ITEM, F_ASSIGNEE_REF).ref(assigneeRef).and().item(AccessCertificationCaseType.F_STAGE_NUMBER).eq().item(T_PARENT, AccessCertificationCampaignType.F_STAGE_NUMBER).asc(F_CURRENT_STAGE_DEADLINE).asc(T_ID).build();
String real = getInterpretedQuery(session, AccessCertificationCaseType.class, query, false);
assertThat(real).isEqualToIgnoringWhitespace("select\n" + " a.ownerOid, a.id, a.fullObject\n" + "from\n" + " RAccessCertificationCase a\n" + " left join a.workItems w\n" + " left join w.assigneeRef a2\n" + " left join a.owner o\n" + "where\n" + " (\n" + " (\n" + " a2.targetOid = :targetOid and\n" + " a2.relation in (:relation) and\n" + " a2.targetType = :targetType\n" + " ) and\n" + " (\n" + " a.stageNumber = o.stageNumber or\n" + " (\n" + " a.stageNumber is null and\n" + " o.stageNumber is null\n" + " )\n" + " )\n" + " )\n" + "order by a.reviewDeadline asc, a.id asc\n");
} finally {
close(session);
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.CaseWorkItemType.F_ASSIGNEE_REF in project midpoint by Evolveum.
the class QueryInterpreterTest method test560DecisionsNotAnswered.
@Test
public void test560DecisionsNotAnswered() throws Exception {
Session session = open();
try {
/*
* ### AccCertCase: Exists (decision: assigneeRef = XYZ and stage = ../stage and response is null or response = NO_RESPONSE)
*/
ObjectQuery query = prismContext.queryFor(AccessCertificationCaseType.class).exists(F_WORK_ITEM).block().item(F_ASSIGNEE_REF).ref("123456").and().item(F_STAGE_NUMBER).eq().item(T_PARENT, AccessCertificationCaseType.F_STAGE_NUMBER).and().item(F_OUTPUT, AbstractWorkItemOutputType.F_OUTCOME).isNull().endBlock().build();
String real = getInterpretedQuery(session, AccessCertificationCaseType.class, query);
assertThat(real).isEqualToIgnoringWhitespace("select\n" + " a.ownerOid, a.id, a.fullObject\n" + "from\n" + " RAccessCertificationCase a\n" + " left join a.workItems w\n" + " left join w.assigneeRef a2\n" + "where\n" + " (\n" + " (\n" + " a2.targetOid = :targetOid and\n" + " a2.relation in (:relation)\n" + " ) and\n" + " (\n" + " w.stageNumber = a.stageNumber or\n" + " (\n" + " w.stageNumber is null and\n" + " a.stageNumber is null\n" + " )\n" + " ) and\n" + " w.outcome is null\n" + " )\n");
} finally {
close(session);
}
}
Aggregations