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;
}
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);
}
Aggregations