KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > workfloweditor > model > WorkflowModel


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.workfloweditor.model;
20
21 import java.util.ArrayList JavaDoc;
22 import java.util.List JavaDoc;
23
24 /**
25  * The model for a workflow.
26  *
27  * @author Matthew Large
28  * @version $Revision: 1.1 $
29  *
30  */

31 public class WorkflowModel {
32
33     /**
34      * List of {@link WorkflowStage} objects.
35      */

36     private ArrayList JavaDoc m_stages = new ArrayList JavaDoc();
37     
38     /**
39      * Title of the workflow.
40      */

41     private String JavaDoc m_sTitle = null;
42     
43     /**
44      * List of {@link Role} objects.
45      */

46     private ArrayList JavaDoc m_availableRoles = new ArrayList JavaDoc();
47
48     /**
49      * Constructs a new workflow model.
50      *
51      * @param sTitle Title
52      */

53     public WorkflowModel(String JavaDoc sTitle) {
54         super();
55         this.m_sTitle = sTitle;
56     }
57     
58     /**
59      * Adds a workflow stage to the model.
60      *
61      * @param stage Workflow stage to add
62      */

63     public void addWorkflowStage(WorkflowStage stage) {
64         this.m_stages.add(stage);
65     }
66     
67     /**
68      * Removes a workflow stage from the model.
69      *
70      * @param stage Workflow stage to remove
71      */

72     public void removeWorkflowStage(WorkflowStage stage) {
73         this.m_stages.remove(stage);
74     }
75     
76     /**
77      * Return a list of workflow stages.
78      *
79      * @return List of {@link WorkflowStage} objects
80      */

81     public List JavaDoc getWorkflowStages() {
82         return (List JavaDoc) this.m_stages.clone();
83     }
84
85     /**
86      * Adds an available role.
87      *
88      * @param role Role to add
89      */

90     public void addAvailableRole(Role role) {
91         this.m_availableRoles.add(role);
92     }
93     
94     /**
95      * Removes an available role.
96      *
97      * @param role Role to remove
98      */

99     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 JavaDoc getAvailableRoles() {
109         return (List JavaDoc) this.m_availableRoles.clone();
110     }
111 }
112
Popular Tags