001: /*
002: * The contents of this file are subject to the
003: * Mozilla Public License Version 1.1 (the "License");
004: * you may not use this file except in compliance with the License.
005: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
009: * See the License for the specific language governing rights and
010: * limitations under the License.
011: *
012: * The Initial Developer of the Original Code is Simulacra Media Ltd.
013: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014: *
015: * All Rights Reserved.
016: *
017: * Contributor(s):
018: */
019: package org.openharmonise.workfloweditor.model;
020:
021: import java.util.ArrayList;
022: import java.util.List;
023:
024: /**
025: * Definition for a workflow stage.
026: *
027: * @author Matthew Large
028: * @version $Revision: 1.1 $
029: *
030: */
031: public class WorkflowStageDefinition {
032:
033: /**
034: * Title.
035: */
036: private String m_sTitle = null;
037:
038: /**
039: * List of {@link Role} objects.
040: */
041: private ArrayList m_roles = new ArrayList();
042:
043: /**
044: * Workflow model.
045: */
046: private WorkflowModel m_model = null;
047:
048: /**
049: * Constructs a new workflow stage definition.
050: *
051: * @param model Model
052: */
053: protected WorkflowStageDefinition(WorkflowModel model) {
054: super ();
055: this .m_model = model;
056: }
057:
058: /**
059: * Constructs a new workflow stage definition.
060: *
061: * @param sTitle Title
062: */
063: public WorkflowStageDefinition(String sTitle) {
064: super ();
065: this .m_sTitle = sTitle;
066: }
067:
068: /**
069: * Returns the title.
070: *
071: * @return Title
072: */
073: public String getTitle() {
074: return this .m_sTitle;
075: }
076:
077: /**
078: * Sets the title.
079: *
080: * @param sTitle Title
081: */
082: public void setTitle(String sTitle) {
083: this .m_sTitle = sTitle;
084: }
085:
086: /**
087: * Adds a role.
088: *
089: * @param role Role to add
090: */
091: public void addRole(Role role) {
092: this .m_roles.add(role);
093: }
094:
095: /**
096: * Removes a role.
097: *
098: * @param role Role to remove
099: */
100: public void removeRole(Role role) {
101: this .m_roles.remove(role);
102: }
103:
104: /**
105: * Returns a list of all the roles.
106: *
107: * @return List of {@link Role} objects
108: */
109: public List getRoles() {
110: return (List) this .m_roles.clone();
111: }
112:
113: /**
114: * Returns the model.
115: *
116: * @return Model
117: */
118: public WorkflowModel getModel() {
119: return this.m_model;
120: }
121:
122: }
|