001 /**
002 * Copyright 2005-2014 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.kew.rule;
017
018 import org.kuali.rice.kim.api.group.Group;
019 import org.kuali.rice.kim.api.services.KimApiServiceLocator;
020 import org.kuali.rice.kim.impl.group.GroupBo;
021
022 /**
023 * Represents a rule responsibility which points to a group.
024 *
025 * @author Kuali Rice Team (rice.collab@kuali.org)
026 *
027 */
028 public class GroupRuleResponsibility extends RuleResponsibilityBo {
029 protected Group group;
030 private String namespaceCode;
031 private String name;
032
033 public String getNamespaceCode() {
034 return this.namespaceCode;
035 }
036
037 public void setNamespaceCode(String namespaceCode) {
038 this.namespaceCode = namespaceCode;
039 }
040
041 public String getName() {
042 return this.name;
043 }
044
045 public void setName(String name) {
046 this.name = name;
047 }
048
049 @Override
050 public Group getGroup() {
051 if (this.group == null) {
052 this.group = KimApiServiceLocator.getGroupService().getGroupByNamespaceCodeAndName(getNamespaceCode(),
053 getName());
054 }
055 return this.group;
056 }
057
058 public GroupBo getGroupBo() {
059 Group grp = null;
060 if (isUsingGroup()) {
061 grp = KimApiServiceLocator.getGroupService().getGroupByNamespaceCodeAndName(getNamespaceCode(),getName());
062 }
063 if(null != grp){
064 return GroupBo.from(grp);
065 } else {
066 return null;
067 }
068 }
069 }