001: /*
002: * Copyright 2005-2007 The Kuali Foundation.
003: *
004: *
005: * Licensed under the Educational Community License, Version 1.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.opensource.org/licenses/ecl1.php
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.kuali.workflow.workgroup;
018:
019: import org.kuali.rice.definition.ObjectDefinition;
020: import org.kuali.rice.resourceloader.GlobalResourceLoader;
021:
022: import edu.iu.uis.eden.exception.WorkflowRuntimeException;
023: import edu.iu.uis.eden.routetemplate.RuleAttribute;
024:
025: /**
026: * Associates WorkgroupTypes to Attributes.
027: *
028: * @author ewestfal
029: */
030: public class WorkgroupTypeAttribute {
031:
032: private Long workgroupTypeAttributeId;
033: private WorkgroupType workgroupType;
034: private RuleAttribute attribute;
035: private Boolean active = true;
036: private int orderIndex;
037: private Integer lockVerNbr;
038:
039: public Object loadAttribute() {
040: try {
041: ObjectDefinition objectDefinition = new ObjectDefinition(
042: getAttribute().getClassName(), getAttribute()
043: .getMessageEntity());
044: Object attribute = GlobalResourceLoader
045: .getObject(objectDefinition);
046: if (attribute == null) {
047: throw new WorkflowRuntimeException(
048: "Could not find attribute " + objectDefinition);
049: }
050: return attribute;
051: } catch (Exception e) {
052: throw new RuntimeException(
053: "Caught error attempting to load attribute class: "
054: + getAttribute().getClassName(), e);
055: }
056: }
057:
058: public RuleAttribute getAttribute() {
059: return attribute;
060: }
061:
062: public void setAttribute(RuleAttribute attribute) {
063: this .attribute = attribute;
064: }
065:
066: public WorkgroupType getWorkgroupType() {
067: return workgroupType;
068: }
069:
070: public void setWorkgroupType(WorkgroupType workgroupType) {
071: this .workgroupType = workgroupType;
072: }
073:
074: public Long getWorkgroupTypeAttributeId() {
075: return workgroupTypeAttributeId;
076: }
077:
078: public void setWorkgroupTypeAttributeId(Long workgroupTypeId) {
079: this .workgroupTypeAttributeId = workgroupTypeId;
080: }
081:
082: public Boolean getActive() {
083: return active;
084: }
085:
086: public void setActive(Boolean active) {
087: this .active = active;
088: }
089:
090: public int getOrderIndex() {
091: return orderIndex;
092: }
093:
094: public void setOrderIndex(int orderIndex) {
095: this .orderIndex = orderIndex;
096: }
097:
098: public Integer getLockVerNbr() {
099: return lockVerNbr;
100: }
101:
102: public void setLockVerNbr(Integer lockVerNbr) {
103: this.lockVerNbr = lockVerNbr;
104: }
105:
106: }
|