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: * The model for a workflow.
026: *
027: * @author Matthew Large
028: * @version $Revision: 1.1 $
029: *
030: */
031: public class WorkflowModel {
032:
033: /**
034: * List of {@link WorkflowStage} objects.
035: */
036: private ArrayList m_stages = new ArrayList();
037:
038: /**
039: * Title of the workflow.
040: */
041: private String m_sTitle = null;
042:
043: /**
044: * List of {@link Role} objects.
045: */
046: private ArrayList m_availableRoles = new ArrayList();
047:
048: /**
049: * Constructs a new workflow model.
050: *
051: * @param sTitle Title
052: */
053: public WorkflowModel(String sTitle) {
054: super ();
055: this .m_sTitle = sTitle;
056: }
057:
058: /**
059: * Adds a workflow stage to the model.
060: *
061: * @param stage Workflow stage to add
062: */
063: public void addWorkflowStage(WorkflowStage stage) {
064: this .m_stages.add(stage);
065: }
066:
067: /**
068: * Removes a workflow stage from the model.
069: *
070: * @param stage Workflow stage to remove
071: */
072: public void removeWorkflowStage(WorkflowStage stage) {
073: this .m_stages.remove(stage);
074: }
075:
076: /**
077: * Return a list of workflow stages.
078: *
079: * @return List of {@link WorkflowStage} objects
080: */
081: public List getWorkflowStages() {
082: return (List) this .m_stages.clone();
083: }
084:
085: /**
086: * Adds an available role.
087: *
088: * @param role Role to add
089: */
090: public void addAvailableRole(Role role) {
091: this .m_availableRoles.add(role);
092: }
093:
094: /**
095: * Removes an available role.
096: *
097: * @param role Role to remove
098: */
099: public void removeAvailableRole(Role role) {
100: this .m_availableRoles.remove(role);
101: }
102:
103: /**
104: * Returns a list of available roles.
105: *
106: * @return List of {@link Role} objects
107: */
108: public List getAvailableRoles() {
109: return (List) this.m_availableRoles.clone();
110: }
111: }
|