Source Code Cross Referenced for WorkProductDescriptor.java in  » Workflow-Engines » wilos » wilos » model » spem2 » workproduct » 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 » wilos » wilos.model.spem2.workproduct 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Wilos Is a cLever process Orchestration Software - http://www.wilos-project.org
003:         * Copyright (C) 2007-2008 Paul Sabatier University, IUP ISI (Toulouse, France) <massie@irit.fr>
004:         *
005:         * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
006:         * General Public License as published by the Free Software Foundation; either version 2 of the License,
007:         * or (at your option) any later version.
008:         *
009:         * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
010:         * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
011:         * GNU General Public License for more details.
012:         *
013:         * You should have received a copy of the GNU General Public License along with this program; if not,
014:         * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
015:         */
016:
017:        package wilos.model.spem2.workproduct;
018:
019:        import java.util.HashSet;
020:        import java.util.Set;
021:
022:        import org.apache.commons.lang.builder.EqualsBuilder;
023:        import org.apache.commons.lang.builder.HashCodeBuilder;
024:
025:        import wilos.model.spem2.activity.Activity;
026:        import wilos.model.misc.concreteworkproduct.ConcreteWorkProductDescriptor;
027:        import wilos.model.spem2.role.RoleDescriptor;
028:        import wilos.model.spem2.task.TaskDescriptor;
029:        import wilos.model.spem2.breakdownelement.BreakdownElement;
030:
031:        /**
032:         * A Work Product Descriptor represents a {@link WorkProductDefinition} in the
033:         * context of one specific Activity. Every breakdown structure can define
034:         * different relationships of {@link WorkProductDefinition} Descriptors to
035:         * {@link TaskDefinition} Descriptors and Role Descriptors. Therefore one
036:         * {@link WorkProductDefinition} can be represented by many Work Product
037:         * Descriptors each within the context of an {@link Activity} with its own set
038:         * of relationships. *
039:         * <p />
040:         * It's an element of the SPEM2 specification of the OMG organization
041:         * (http://www.omg.org/).
042:         * 
043:         */
044:        public class WorkProductDescriptor extends BreakdownElement implements 
045:                Cloneable {
046:
047:            /**
048:             * the attached WorkProductDefinition
049:             */
050:            private WorkProductDefinition workProductDefinition;
051:
052:            /**
053:             * Associated ConcreteWorkProductDescriptor.
054:             */
055:            private Set<ConcreteWorkProductDescriptor> concreteWorkProductDescriptors;
056:
057:            private boolean isDeliverable;
058:
059:            private RoleDescriptor responsibleRoleDescriptor;
060:
061:            private String activityEntryState = "";
062:
063:            private String activityExitState = "";
064:
065:            private Set<Activity> userActivities;
066:
067:            private Set<Activity> producerActivities;
068:
069:            private Set<TaskDescriptor> producerTasks;
070:
071:            private Set<TaskDescriptor> optionalUserTasks;
072:
073:            private Set<TaskDescriptor> mandatoryUserTasks;
074:
075:            private boolean isOutOfProcess;
076:
077:            public WorkProductDescriptor() {
078:                super ();
079:                this .concreteWorkProductDescriptors = new HashSet<ConcreteWorkProductDescriptor>();
080:                this .userActivities = new HashSet<Activity>();
081:                this .producerActivities = new HashSet<Activity>();
082:                this .producerTasks = new HashSet<TaskDescriptor>();
083:                this .optionalUserTasks = new HashSet<TaskDescriptor>();
084:                this .mandatoryUserTasks = new HashSet<TaskDescriptor>();
085:                this .isOutOfProcess = false;
086:            }
087:
088:            /*
089:             * (non-Javadoc)
090:             * 
091:             * @see java.lang.Object#clone()
092:             */
093:            @Override
094:            public WorkProductDescriptor clone()
095:                    throws CloneNotSupportedException {
096:                WorkProductDescriptor workProductDescriptor = new WorkProductDescriptor();
097:                workProductDescriptor.copy(this );
098:                return workProductDescriptor;
099:            }
100:
101:            /**
102:             * Copy the object.
103:             * 
104:             * @param _workProductDescriptor
105:             *                The RoleDescriptor to copy.
106:             */
107:            protected void copy(
108:                    final WorkProductDescriptor _workProductDescriptor) {
109:                super .copy(_workProductDescriptor);
110:                this .workProductDefinition = _workProductDescriptor
111:                        .getWorkProductDefinition();
112:                this .concreteWorkProductDescriptors
113:                        .addAll(_workProductDescriptor
114:                                .getConcreteWorkProductDescriptors());
115:                this .responsibleRoleDescriptor = _workProductDescriptor
116:                        .getResponsibleRoleDescriptor();
117:                this .isDeliverable = _workProductDescriptor.isDeliverable();
118:                this .activityEntryState = _workProductDescriptor
119:                        .getActivityEntryState();
120:                this .activityExitState = _workProductDescriptor
121:                        .getActivityExitState();
122:
123:                this .producerTasks.addAll(_workProductDescriptor
124:                        .getProducerTasks());
125:                this .optionalUserTasks.addAll(_workProductDescriptor
126:                        .getOptionalUserTasks());
127:                this .mandatoryUserTasks.addAll(_workProductDescriptor
128:                        .getMandatoryUserTasks());
129:                this .isOutOfProcess = _workProductDescriptor
130:                        .getIsOutOfProcess();
131:            }
132:
133:            /*
134:             * (non-Javadoc)
135:             * 
136:             * @see wilos.model.spem2.breakdownelement.BreakdownElement#equals(java.lang.Object)
137:             */
138:            public boolean equals(Object obj) {
139:                if (obj instanceof  WorkProductDescriptor == false) {
140:                    return false;
141:                }
142:                if (this  == obj) {
143:                    return true;
144:                }
145:
146:                WorkProductDescriptor workProductDescriptor = (WorkProductDescriptor) obj;
147:                return new EqualsBuilder()
148:                        .appendSuper(super .equals(workProductDescriptor))
149:                        .append(this .workProductDefinition,
150:                                workProductDescriptor.workProductDefinition)
151:                        .append(
152:                                this .concreteWorkProductDescriptors,
153:                                workProductDescriptor.concreteWorkProductDescriptors)
154:                        .append(this .isDeliverable,
155:                                workProductDescriptor.isDeliverable)
156:                        .append(this .activityEntryState,
157:                                workProductDescriptor.activityEntryState)
158:                        .append(this .activityExitState,
159:                                workProductDescriptor.activityExitState)
160:                        .append(this .producerActivities,
161:                                workProductDescriptor.producerActivities)
162:                        .append(this .userActivities,
163:                                workProductDescriptor.userActivities)
164:                        .append(this .responsibleRoleDescriptor,
165:                                workProductDescriptor.responsibleRoleDescriptor)
166:                        .append(this .producerTasks,
167:                                workProductDescriptor.producerTasks).append(
168:                                this .optionalUserTasks,
169:                                workProductDescriptor.optionalUserTasks)
170:                        .append(this .mandatoryUserTasks,
171:                                workProductDescriptor.mandatoryUserTasks)
172:                        .append(this .isOutOfProcess,
173:                                workProductDescriptor.isOutOfProcess)
174:                        .isEquals();
175:            }
176:
177:            /*
178:             * (non-Javadoc)
179:             * 
180:             * @see wilos.model.spem2.breakdownelement.BreakdownElement#hashCode()
181:             */
182:            public int hashCode() {
183:                return new HashCodeBuilder(17, 37)
184:                        .appendSuper(super .hashCode()).append(
185:                                this .workProductDefinition).toHashCode();
186:            }
187:
188:            /*
189:             * relation between WOrkProductDescriptor and ConcreteWorkProductDescriptor.
190:             * 
191:             */
192:
193:            /**
194:             * @param _workProductDescriptor
195:             */
196:            public void addConcreteWorkProductDescriptor(
197:                    ConcreteWorkProductDescriptor _concreteWorkProductDescriptor) {
198:                this .concreteWorkProductDescriptors
199:                        .add(_concreteWorkProductDescriptor);
200:                _concreteWorkProductDescriptor.addWorkProductDescriptor(this );
201:            }
202:
203:            /**
204:             * @param _workProductDescriptor
205:             */
206:            public void removeConcreteWorkProductDescriptor(
207:                    ConcreteWorkProductDescriptor _concreteWorkProductDescriptor) {
208:                _concreteWorkProductDescriptor
209:                        .removeWorkProductDescriptor(this );
210:                this .concreteWorkProductDescriptors
211:                        .remove(_concreteWorkProductDescriptor);
212:            }
213:
214:            public void addAllConcreteWorkProductDescriptors(
215:                    Set<ConcreteWorkProductDescriptor> _concreteWorkProductDescriptors) {
216:                for (ConcreteWorkProductDescriptor cwpd : _concreteWorkProductDescriptors) {
217:                    cwpd.addWorkProductDescriptor(this );
218:                }
219:            }
220:
221:            public void removeAllConcreteWorkProductDescriptors() {
222:                for (ConcreteWorkProductDescriptor cwpd : this 
223:                        .getConcreteWorkProductDescriptors())
224:                    cwpd.setWorkProductDescriptor(null);
225:                this .getConcreteWorkProductDescriptors().clear();
226:            }
227:
228:            /*
229:             * relation between WorkProductDescriptor and WorkProductDefinition
230:             */
231:
232:            /**
233:             * Add a WorkProductDefinition to the Set
234:             * 
235:             * @param _workProduct
236:             */
237:            public void addWorkProductDefinition(
238:                    WorkProductDefinition _workProduct) {
239:                this .workProductDefinition = _workProduct;
240:                _workProduct.getWorkProductDescriptors().add(this );
241:            }
242:
243:            /**
244:             * remove a WorkProductDefinition
245:             * 
246:             * @param _workProduct
247:             */
248:            public void removeWorkProductDefinition(
249:                    WorkProductDefinition _workProduct) {
250:                _workProduct.getWorkProductDescriptors().remove(this );
251:                this .workProductDefinition = null;
252:            }
253:
254:            /*
255:             * Getter and Setter.
256:             */
257:
258:            /**
259:             * Getter of workProductDefinition.
260:             * 
261:             * @return the workProductDefinition.
262:             */
263:            public WorkProductDefinition getWorkProductDefinition() {
264:                return this .workProductDefinition;
265:            }
266:
267:            /**
268:             * Setter of workProductDefinition.
269:             * 
270:             * @param _workProductDefinition
271:             *                The workProductDefinition to set.
272:             */
273:            public void setWorkProductDefinition(
274:                    WorkProductDefinition _workProductDefinition) {
275:                this .workProductDefinition = _workProductDefinition;
276:            }
277:
278:            public Set<ConcreteWorkProductDescriptor> getConcreteWorkProductDescriptors() {
279:                return concreteWorkProductDescriptors;
280:            }
281:
282:            public void setConcreteWorkProductDescriptors(
283:                    Set<ConcreteWorkProductDescriptor> concreteWorkProductDescriptors) {
284:                this .concreteWorkProductDescriptors = concreteWorkProductDescriptors;
285:            }
286:
287:            /**
288:             * @return the isDeliverable
289:             */
290:            public boolean isDeliverable() {
291:                return this .isDeliverable;
292:            }
293:
294:            /**
295:             * @param _isDeliverable
296:             *                the isDeliverable to set
297:             */
298:            public void setDeliverable(boolean _isDeliverable) {
299:                this .isDeliverable = _isDeliverable;
300:            }
301:
302:            /**
303:             * @return the activityEntryState
304:             */
305:            public String getActivityEntryState() {
306:                return this .activityEntryState;
307:            }
308:
309:            /**
310:             * @param _activityEntryState
311:             *                the activityEntryState to set
312:             */
313:            public void setActivityEntryState(String _activityEntryState) {
314:                this .activityEntryState = _activityEntryState;
315:            }
316:
317:            /**
318:             * @return the activityExitState
319:             */
320:            public String getActivityExitState() {
321:                return this .activityExitState;
322:            }
323:
324:            /**
325:             * @param _activityExitState
326:             *                the activityExitState to set
327:             */
328:            public void setActivityExitState(String _activityExitState) {
329:                this .activityExitState = _activityExitState;
330:            }
331:
332:            /**
333:             * @return the userActivities
334:             */
335:            public Set<Activity> getUserActivities() {
336:                return userActivities;
337:            }
338:
339:            /**
340:             * @return the producerActivities
341:             */
342:            public Set<Activity> getProducerActivities() {
343:                return producerActivities;
344:            }
345:
346:            /**
347:             * @param _userActivities
348:             *                the userActivities to set
349:             */
350:            public void setUserActivities(Set<Activity> _userActivities) {
351:                userActivities = _userActivities;
352:            }
353:
354:            /**
355:             * @param _producerActivities
356:             *                the producerActivities to set
357:             */
358:            public void setProducerActivities(Set<Activity> _producerActivities) {
359:                producerActivities = _producerActivities;
360:            }
361:
362:            /**
363:             * @return the responsibleRoleDescriptor
364:             */
365:            public RoleDescriptor getResponsibleRoleDescriptor() {
366:                return this .responsibleRoleDescriptor;
367:            }
368:
369:            /**
370:             * @param _responsibleRoleDescriptor
371:             *                the responsibleRoleDescriptor to set
372:             */
373:            public void setResponsibleRoleDescriptor(
374:                    RoleDescriptor _responsibleRoleDescriptor) {
375:                this .responsibleRoleDescriptor = _responsibleRoleDescriptor;
376:            }
377:
378:            /**
379:             * Attach a workProductDescriptor to a roleDescriptor
380:             * 
381:             * @param _roleDescriptor
382:             */
383:            public void addResponsibleRole(RoleDescriptor _roleDescriptor) {
384:                this .responsibleRoleDescriptor = _roleDescriptor;
385:                _roleDescriptor.getResponsibleFor().add(this );
386:            }
387:
388:            /**
389:             * @return the producerTasks i.e. return a list of tasks which produce this
390:             *         workproduct
391:             */
392:            public Set<TaskDescriptor> getProducerTasks() {
393:                return this .producerTasks;
394:            }
395:
396:            /**
397:             * @param _producerTasks
398:             *                the producerTasks to set
399:             */
400:            public void setProducerTasks(Set<TaskDescriptor> _producerTasks) {
401:                this .producerTasks = _producerTasks;
402:            }
403:
404:            /**
405:             * @return the optionalUserTasks
406:             */
407:            public Set<TaskDescriptor> getOptionalUserTasks() {
408:                return this .optionalUserTasks;
409:            }
410:
411:            /**
412:             * @param _optionalUserTasks
413:             *                the optionalUserTasks to set
414:             */
415:            public void setOptionalUserTasks(
416:                    Set<TaskDescriptor> _optionalUserTasks) {
417:                this .optionalUserTasks = _optionalUserTasks;
418:            }
419:
420:            /**
421:             * @return the mandatoryUserTasks
422:             */
423:            public Set<TaskDescriptor> getMandatoryUserTasks() {
424:                return this .mandatoryUserTasks;
425:            }
426:
427:            /**
428:             * @param _mandatoryUserTasks
429:             *                the mandatoryUserTasks to set
430:             */
431:            public void setMandatoryUserTasks(
432:                    Set<TaskDescriptor> _mandatoryUserTasks) {
433:                this .mandatoryUserTasks = _mandatoryUserTasks;
434:            }
435:
436:            /**
437:             * @param _taskDescriptor
438:             */
439:            public void addProducerTask(TaskDescriptor _taskDescriptor) {
440:                this .producerTasks.add(_taskDescriptor);
441:                _taskDescriptor.getOutputWorkProductDescriptors().add(this );
442:
443:            }
444:
445:            /**
446:             * @param _taskDescriptor
447:             */
448:            public void addOptionalUser(TaskDescriptor _taskDescriptor) {
449:                this .optionalUserTasks.add(_taskDescriptor);
450:                _taskDescriptor.getOptionalInputWorkProductDescriptors().add(
451:                        this );
452:
453:            }
454:
455:            /**
456:             * @param _taskDescriptor
457:             */
458:            public void addMandatoryUser(TaskDescriptor _taskDescriptor) {
459:                this .mandatoryUserTasks.add(_taskDescriptor);
460:                _taskDescriptor.getMandatoryInputWorkProductDescriptors().add(
461:                        this );
462:
463:            }
464:
465:            /**
466:             * @param _producerTasks
467:             */
468:            public void addAllProducerTasks(Set<TaskDescriptor> _producerTasks) {
469:                for (TaskDescriptor task : _producerTasks) {
470:                    task.addOutputWorkProduct(this );
471:                }
472:
473:            }
474:
475:            /**
476:             * @param _optionalUserTasks
477:             */
478:            public void addAllOptionalUserTasks(
479:                    Set<TaskDescriptor> _optionalUserTasks) {
480:                for (TaskDescriptor task : _optionalUserTasks) {
481:                    task.addOptionalInputWorkProduct(this );
482:                }
483:
484:            }
485:
486:            /**
487:             * @param _mandatoryUserTasks
488:             */
489:            public void addAllMandatoryUserTasks(
490:                    Set<TaskDescriptor> _mandatoryUserTasks) {
491:                for (TaskDescriptor task : _mandatoryUserTasks) {
492:                    task.addMandatoryInputWorkProduct(this );
493:                }
494:
495:            }
496:
497:            /**
498:             * @return the isOutOfProcess
499:             */
500:            public boolean getIsOutOfProcess() {
501:                return this .isOutOfProcess;
502:            }
503:
504:            /**
505:             * @param _isOutOfProcess the isOutOfProcess to set
506:             */
507:            public void setIsOutOfProcess(boolean _isOutOfProcess) {
508:                this.isOutOfProcess = _isOutOfProcess;
509:            }
510:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.