Search in sources :

Example 1 with RCaseWorkItemReferenceOwner

use of com.evolveum.midpoint.repo.sql.data.common.other.RCaseWorkItemReferenceOwner in project midpoint by Evolveum.

the class CaseWorkItemReferenceMapper method map.

@Override
public RCaseWorkItemReference map(Referencable input, MapperContext context) {
    RCaseWorkItem owner = (RCaseWorkItem) context.getOwner();
    ObjectReferenceType objectRef = buildReference(input);
    RCaseWorkItemReferenceOwner type;
    ItemName name = context.getDelta().getPath().lastName();
    if (QNameUtil.match(name, CaseWorkItemType.F_ASSIGNEE_REF)) {
        type = RCaseWorkItemReferenceOwner.ASSIGNEE;
    } else if (QNameUtil.match(name, CaseWorkItemType.F_CANDIDATE_REF)) {
        type = RCaseWorkItemReferenceOwner.CANDIDATE;
    } else {
        throw new IllegalStateException("Unknown case work item reference owner: " + name + "(delta = " + context.getDelta() + ")");
    }
    return RCaseWorkItemReference.jaxbRefToRepo(objectRef, owner, context.getRelationRegistry(), type);
}
Also used : RCaseWorkItem(com.evolveum.midpoint.repo.sql.data.common.container.RCaseWorkItem) ObjectReferenceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType) RCaseWorkItemReferenceOwner(com.evolveum.midpoint.repo.sql.data.common.other.RCaseWorkItemReferenceOwner) ItemName(com.evolveum.midpoint.prism.path.ItemName)

Aggregations

ItemName (com.evolveum.midpoint.prism.path.ItemName)1 RCaseWorkItem (com.evolveum.midpoint.repo.sql.data.common.container.RCaseWorkItem)1 RCaseWorkItemReferenceOwner (com.evolveum.midpoint.repo.sql.data.common.other.RCaseWorkItemReferenceOwner)1 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)1