Source Code Cross Referenced for Task.java in  » Workflow-Engines » jbpm-jpdl-3.2.2 » org » jbpm » taskmgmt » def » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » jbpm jpdl 3.2.2 » org.jbpm.taskmgmt.def 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JBoss, Home of Professional Open Source
003:         * Copyright 2005, JBoss Inc., and individual contributors as indicated
004:         * by the @authors tag. See the copyright.txt in the distribution for a
005:         * full listing of individual contributors.
006:         *
007:         * This is free software; you can redistribute it and/or modify it
008:         * under the terms of the GNU Lesser General Public License as
009:         * published by the Free Software Foundation; either version 2.1 of
010:         * the License, or (at your option) any later version.
011:         *
012:         * This software is distributed in the hope that it will be useful,
013:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
014:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015:         * Lesser General Public License for more details.
016:         *
017:         * You should have received a copy of the GNU Lesser General Public
018:         * License along with this software; if not, write to the Free
019:         * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020:         * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021:         */
022:        package org.jbpm.taskmgmt.def;
023:
024:        import org.jbpm.JbpmException;
025:        import org.jbpm.graph.def.Event;
026:        import org.jbpm.graph.def.GraphElement;
027:        import org.jbpm.graph.node.StartState;
028:        import org.jbpm.graph.node.TaskNode;
029:        import org.jbpm.instantiation.Delegation;
030:
031:        /**
032:         * defines a task and how the actor must be calculated at runtime.
033:         */
034:        public class Task extends GraphElement {
035:
036:            private static final long serialVersionUID = 1L;
037:
038:            public static final int PRIORITY_HIGHEST = 1;
039:            public static final int PRIORITY_HIGH = 2;
040:            public static final int PRIORITY_NORMAL = 3;
041:            public static final int PRIORITY_LOW = 4;
042:            public static final int PRIORITY_LOWEST = 5;
043:
044:            public static int parsePriority(String priorityText) {
045:                if ("highest".equalsIgnoreCase(priorityText))
046:                    return PRIORITY_HIGHEST;
047:                else if ("high".equalsIgnoreCase(priorityText))
048:                    return PRIORITY_HIGH;
049:                else if ("normal".equalsIgnoreCase(priorityText))
050:                    return PRIORITY_NORMAL;
051:                else if ("low".equalsIgnoreCase(priorityText))
052:                    return PRIORITY_LOW;
053:                else if ("lowest".equalsIgnoreCase(priorityText))
054:                    return PRIORITY_LOWEST;
055:                try {
056:                    return Integer.parseInt(priorityText);
057:                } catch (NumberFormatException e) {
058:                    throw new JbpmException("priority '" + priorityText
059:                            + "' could not be parsed as a priority");
060:                }
061:            }
062:
063:            protected boolean isBlocking = false;
064:            protected boolean isSignalling = true;
065:            protected String condition = null;
066:            protected String dueDate = null;
067:            protected int priority = PRIORITY_NORMAL;
068:            protected TaskNode taskNode = null;
069:            protected StartState startState = null;
070:            protected TaskMgmtDefinition taskMgmtDefinition = null;
071:            protected Swimlane swimlane = null;
072:            protected String actorIdExpression = null;
073:            protected String pooledActorsExpression = null;
074:            protected Delegation assignmentDelegation = null;
075:            protected TaskController taskController = null;
076:
077:            public Task() {
078:            }
079:
080:            public Task(String name) {
081:                this .name = name;
082:            }
083:
084:            // event types //////////////////////////////////////////////////////////////
085:
086:            static final String[] supportedEventTypes = new String[] {
087:                    Event.EVENTTYPE_TASK_CREATE, Event.EVENTTYPE_TASK_ASSIGN,
088:                    Event.EVENTTYPE_TASK_START, Event.EVENTTYPE_TASK_END };
089:
090:            public String[] getSupportedEventTypes() {
091:                return supportedEventTypes;
092:            }
093:
094:            // task instance factory methods ////////////////////////////////////////////
095:
096:            /**
097:             * sets the taskNode unidirectionally.  use {@link TaskNode#addTask(Task)} to create 
098:             * a bidirectional relation.
099:             */
100:            public void setTaskNode(TaskNode taskNode) {
101:                this .taskNode = taskNode;
102:            }
103:
104:            /**
105:             * sets the taskMgmtDefinition unidirectionally.  use TaskMgmtDefinition.addTask to create 
106:             * a bidirectional relation.
107:             */
108:            public void setTaskMgmtDefinition(
109:                    TaskMgmtDefinition taskMgmtDefinition) {
110:                this .taskMgmtDefinition = taskMgmtDefinition;
111:            }
112:
113:            /**
114:             * sets the swimlane.  Since a task can have max one of swimlane or assignmentHandler, 
115:             * this method removes the swimlane if it is set.
116:             */
117:            public void setAssignmentDelegation(Delegation assignmentDelegation) {
118:                this .actorIdExpression = null;
119:                this .pooledActorsExpression = null;
120:                this .assignmentDelegation = assignmentDelegation;
121:                this .swimlane = null;
122:            }
123:
124:            /**
125:             * sets the actorId expression.  The assignmentExpression is a JSF-like
126:             * expression to perform assignment.  Since a task can have max one of swimlane or 
127:             * assignmentHandler, this method removes the swimlane and assignmentDelegation if 
128:             * it is set.
129:             */
130:            public void setActorIdExpression(String actorIdExpression) {
131:                this .actorIdExpression = actorIdExpression;
132:                // Note: combination of actorIdExpression and pooledActorsExpression is allowed 
133:                // this.pooledActorsExpression = null;
134:                this .assignmentDelegation = null;
135:                this .swimlane = null;
136:            }
137:
138:            /**
139:             * sets the actorId expression.  The assignmentExpression is a JSF-like
140:             * expression to perform assignment.  Since a task can have max one of swimlane or 
141:             * assignmentHandler, this method removes the other forms of assignment.
142:             */
143:            public void setPooledActorsExpression(String pooledActorsExpression) {
144:                // Note: combination of actorIdExpression and pooledActorsExpression is allowed 
145:                // this.actorIdExpression = null;
146:                this .pooledActorsExpression = pooledActorsExpression;
147:                this .assignmentDelegation = null;
148:                this .swimlane = null;
149:            }
150:
151:            /**
152:             * sets the swimlane unidirectionally.  Since a task can have max one of swimlane or assignmentHandler, 
153:             * this method removes the assignmentHandler and assignmentExpression if one of those isset.  To create 
154:             * a bidirectional relation, use {@link Swimlane#addTask(Task)}.
155:             */
156:            public void setSwimlane(Swimlane swimlane) {
157:                this .actorIdExpression = null;
158:                this .pooledActorsExpression = null;
159:                this .assignmentDelegation = null;
160:                this .swimlane = swimlane;
161:            }
162:
163:            // parent ///////////////////////////////////////////////////////////////////
164:
165:            public GraphElement getParent() {
166:                if (taskNode != null) {
167:                    return taskNode;
168:                }
169:                if (startState != null) {
170:                    return startState;
171:                }
172:                return processDefinition;
173:            }
174:
175:            // getters and setters //////////////////////////////////////////////////////
176:
177:            public TaskMgmtDefinition getTaskMgmtDefinition() {
178:                return taskMgmtDefinition;
179:            }
180:
181:            public Swimlane getSwimlane() {
182:                return swimlane;
183:            }
184:
185:            public boolean isBlocking() {
186:                return isBlocking;
187:            }
188:
189:            public void setBlocking(boolean isBlocking) {
190:                this .isBlocking = isBlocking;
191:            }
192:
193:            public TaskNode getTaskNode() {
194:                return taskNode;
195:            }
196:
197:            public String getActorIdExpression() {
198:                return actorIdExpression;
199:            }
200:
201:            public String getPooledActorsExpression() {
202:                return pooledActorsExpression;
203:            }
204:
205:            public Delegation getAssignmentDelegation() {
206:                return assignmentDelegation;
207:            }
208:
209:            public String getDueDate() {
210:                return dueDate;
211:            }
212:
213:            public void setDueDate(String duedate) {
214:                this .dueDate = duedate;
215:            }
216:
217:            public TaskController getTaskController() {
218:                return taskController;
219:            }
220:
221:            public void setTaskController(TaskController taskController) {
222:                this .taskController = taskController;
223:            }
224:
225:            public int getPriority() {
226:                return priority;
227:            }
228:
229:            public void setPriority(int priority) {
230:                this .priority = priority;
231:            }
232:
233:            public StartState getStartState() {
234:                return startState;
235:            }
236:
237:            public void setStartState(StartState startState) {
238:                this .startState = startState;
239:            }
240:
241:            public boolean isSignalling() {
242:                return isSignalling;
243:            }
244:
245:            public void setSignalling(boolean isSignalling) {
246:                this .isSignalling = isSignalling;
247:            }
248:
249:            public String getCondition() {
250:                return condition;
251:            }
252:
253:            public void setCondition(String condition) {
254:                this.condition = condition;
255:            }
256:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.