Search in sources :

Example 1 with RCaseWorkItem

use of com.evolveum.midpoint.repo.sql.data.common.container.RCaseWorkItem in project midpoint by Evolveum.

the class CaseWorkItemMapper method map.

@Override
public RCaseWorkItem map(CaseWorkItemType input, MapperContext context) {
    RCase owner = (RCase) context.getOwner();
    RCaseWorkItem item;
    try {
        item = RCaseWorkItem.toRepo(owner, input, context.getRepositoryContext());
    } catch (DtoTranslationException ex) {
        throw new SystemException("Couldn't translate CaseWorkItemType to entity", ex);
    }
    return item;
}
Also used : RCase(com.evolveum.midpoint.repo.sql.data.common.RCase) DtoTranslationException(com.evolveum.midpoint.repo.sql.util.DtoTranslationException) RCaseWorkItem(com.evolveum.midpoint.repo.sql.data.common.container.RCaseWorkItem) SystemException(com.evolveum.midpoint.util.exception.SystemException)

Example 2 with RCaseWorkItem

use of com.evolveum.midpoint.repo.sql.data.common.container.RCaseWorkItem 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

RCaseWorkItem (com.evolveum.midpoint.repo.sql.data.common.container.RCaseWorkItem)2 ItemName (com.evolveum.midpoint.prism.path.ItemName)1 RCase (com.evolveum.midpoint.repo.sql.data.common.RCase)1 RCaseWorkItemReferenceOwner (com.evolveum.midpoint.repo.sql.data.common.other.RCaseWorkItemReferenceOwner)1 DtoTranslationException (com.evolveum.midpoint.repo.sql.util.DtoTranslationException)1 SystemException (com.evolveum.midpoint.util.exception.SystemException)1 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)1