001 /** 002 * Copyright 2005-2011 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 java.util.ArrayList; 019 import java.util.List; 020 021 import org.kuali.rice.kew.api.identity.Id; 022 import org.kuali.rice.kew.api.rule.RoleName; 023 import org.kuali.rice.kew.engine.RouteContext; 024 import org.kuali.rice.kew.routeheader.DocumentContent; 025 import org.kuali.rice.kew.workgroup.GroupNameId; 026 027 028 /** 029 * 030 * @author Kuali Rice Team (rice.collab@kuali.org) 031 */ 032 public class TestWorkgroupRoleAttribute extends AbstractRoleAttribute { 033 034 private static final long serialVersionUID = 7650315462958972080L; 035 036 037 public List<RoleName> getRoleNames() { 038 List<RoleName> roles = new ArrayList<RoleName>(); 039 roles.add(new RoleName(getClass().getName(), "workgroup", "workgroup label")); 040 return roles; 041 } 042 043 public List<String> getQualifiedRoleNames(String roleName, DocumentContent documentContent) { 044 List<String> qualRoleNames = new ArrayList<String>(); 045 qualRoleNames.add("KR-WKFLW:TestWorkgroup"); 046 return qualRoleNames; 047 } 048 049 050 public ResolvedQualifiedRole resolveQualifiedRole(RouteContext routeContext, String roleName, String qualifiedRole) { 051 List<Id> recipients = new ArrayList<Id>(); 052 recipients.add(new GroupNameId(qualifiedRole)); 053 return new ResolvedQualifiedRole("workgroup role lable", recipients); 054 } 055 056 057 058 }