public <V extends PrismValue, D extends ItemDefinition, AH extends AssignmentHolderType> Source<V,D> constructDefaultSource(ObjectDeltaObject<AH> focusOdo) throws SchemaException {
if (objectTemplateMappingType != null) {
return null;
}
PrismObject<AH> focus = focusOdo.getAnyObject();
assignmentDef = focus.getDefinition().findContainerDefinition(FocusType.F_ASSIGNMENT);
PrismContainer<AssignmentType> assignment = assignmentDef.instantiate();
assignmentType = assignment.createNewValue().asContainerable();
QName relation = null;
AssignmentPropertiesSpecificationType assignmentProperties = autoassignMappingType.getAssignmentProperties();
if (assignmentProperties != null) {
relation = assignmentProperties.getRelation();
assignmentType.getSubtype().addAll(assignmentProperties.getSubtype());
}
assignmentType.targetRef(role.getOid(), role.asPrismObject().getDefinition().getTypeName(), relation);
Source<PrismContainerValue<AssignmentType>, PrismContainerDefinition<AssignmentType>> source =
new Source<>(assignment, null, assignment, FocusType.F_ASSIGNMENT);
return (Source<V, D>) source;
}