Search in sources :

Example 1 with Template

use of org.kuali.kfs.kim.impl.common.template.Template in project cu-kfs by CU-CommunityApps.

the class ResponsibilityServiceImpl method getResponsibilityTypeServicesByTemplateId.

private Map<String, ResponsibilityTypeService> getResponsibilityTypeServicesByTemplateId(Collection<Responsibility> responsibilities) {
    Map<String, ResponsibilityTypeService> responsibilityTypeServices = new HashMap<>(responsibilities.size());
    for (Responsibility responsibility : responsibilities) {
        final Template t = responsibility.getTemplate();
        final KimType type = kimTypeInfoService.getKimType(t.getKimTypeId());
        final String serviceName = type.getServiceName();
        if (serviceName != null) {
            ResponsibilityTypeService responsibiltyTypeService = GlobalResourceLoader.getService(QName.valueOf(serviceName));
            if (responsibiltyTypeService != null) {
                responsibilityTypeServices.put(responsibility.getTemplate().getId(), responsibiltyTypeService);
            } else {
                responsibilityTypeServices.put(responsibility.getTemplate().getId(), defaultResponsibilityTypeService);
            }
        }
    }
    return Collections.unmodifiableMap(responsibilityTypeServices);
}
Also used : KimType(org.kuali.kfs.kim.impl.type.KimType) HashMap(java.util.HashMap) ResponsibilityTypeService(org.kuali.kfs.kim.framework.responsibility.ResponsibilityTypeService) RoleResponsibility(org.kuali.kfs.kim.impl.role.RoleResponsibility) Template(org.kuali.kfs.kim.impl.common.template.Template)

Aggregations

HashMap (java.util.HashMap)1 ResponsibilityTypeService (org.kuali.kfs.kim.framework.responsibility.ResponsibilityTypeService)1 Template (org.kuali.kfs.kim.impl.common.template.Template)1 RoleResponsibility (org.kuali.kfs.kim.impl.role.RoleResponsibility)1 KimType (org.kuali.kfs.kim.impl.type.KimType)1