Source Code Cross Referenced for WorkItem.java in  » Workflow-Engines » Bossa » com » bigbross » bossa » wfnet » 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 » Bossa » com.bigbross.bossa.wfnet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Bossa Workflow System
003:         *
004:         * $Id: WorkItem.java,v 1.20 2004/02/04 21:46:36 gdvieira Exp $
005:         *
006:         * Copyright (C) 2003,2004 OpenBR Sistemas S/C Ltda.
007:         *
008:         * This file is part of Bossa.
009:         *
010:         * Bossa is free software; you can redistribute it and/or modify it
011:         * under the terms of version 2 of the GNU General Public License as
012:         * published by the Free Software Foundation.
013:         *
014:         * This program is distributed in the hope that it will be useful,
015:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
016:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
017:         * General Public License for more details.
018:         *
019:         * You should have received a copy of the GNU General Public
020:         * License along with this program; if not, write to the
021:         * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
022:         * Boston, MA 02111-1307, USA.
023:         */
024:
025:        package com.bigbross.bossa.wfnet;
026:
027:        import java.io.Serializable;
028:
029:        import com.bigbross.bossa.BossaException;
030:        import com.bigbross.bossa.resource.Expression;
031:        import com.bigbross.bossa.resource.Resource;
032:
033:        /**
034:         * This class represents a transition of a specific case instance. <p>
035:         * 
036:         * We use a somewhat non standard definition of a work item: instead of
037:         * a <emph>fireable</emph> transition a work item is a <emph>likely 
038:         * fireable</emph> transition. All methods of this class account for this
039:         * and it is possible to discover in advance if a work item is actually
040:         * fireable without opening it. <p>
041:         *
042:         * @author <a href="http://www.bigbross.com">BigBross Team</a>
043:         */
044:        public class WorkItem implements  Serializable {
045:
046:            private Case caze;
047:
048:            private Transition transition;
049:
050:            private boolean fireable;
051:
052:            /**
053:             * Creates a new work item. <p>
054:             * 
055:             * @param caze the case.
056:             * @param transition the transition.
057:             * @param fireable the work item fireable status.
058:             */
059:            WorkItem(Case caze, Transition transition, boolean fireable) {
060:                this .caze = caze;
061:                this .transition = transition;
062:                this .fireable = fireable;
063:            }
064:
065:            /**
066:             * Returns the case type of this work item. <p>
067:             * 
068:             * @return the case type of this work item.
069:             */
070:            public CaseType getCaseType() {
071:                return getCase().getCaseType();
072:            }
073:
074:            /**
075:             * Returns the case of this work item. <p>
076:             * 
077:             * @return the case of this work item.
078:             */
079:            public Case getCase() {
080:                return caze;
081:            }
082:
083:            /**
084:             * Returns the transition this work item represents. <p>
085:             * 
086:             * @return the transition this work item represents.
087:             */
088:            Transition getTransition() {
089:                return transition;
090:            }
091:
092:            /**
093:             * Returns the id of this work item. It is the same id of the
094:             * transition this work item represents. <p>
095:             * 
096:             * @return the id of this work item.
097:             */
098:            public String getId() {
099:                return getTransition().getId();
100:            }
101:
102:            /**
103:             * Indicates if this work item is fireable. <p>
104:             * 
105:             * @return <code>true</code> if the work item is fireable;
106:             *         <code>false</code> otherwise.
107:             */
108:            public boolean isFireable() {
109:                return fireable;
110:            }
111:
112:            /**
113:             * Indicates if this work item can be open by the provided resource. <p>
114:             * 
115:             * @param resource the resource.
116:             * @return <code>true</code> if the resource can open this work item;
117:             *         <code>false</code> otherwise.
118:             */
119:            public boolean canBePerformedBy(Resource resource) {
120:                Expression e = getTransition().getResource();
121:                return e == null ? true : e.contains(
122:                        caze.getResourceRegistry(), resource);
123:            }
124:
125:            /**
126:             * Updates the firing status of this work item. <p>
127:             * 
128:             * @return <code>true</code> if the work item is fireable,
129:             *         <code>false</code> otherwise.
130:             * @exception EvaluationException if an expression evaluation error
131:             *            occurs.
132:             */
133:            boolean update() throws EvaluationException {
134:                return fireable = getCase().isFireable(transition);
135:            }
136:
137:            /**
138:             * Opens this work item. A open work item is represented by
139:             * an activity and is locked to the resource who opened it. The actual
140:             * completion of the work item in handled by the created activity. <p>
141:             * 
142:             * @param resource the resource that is opening the work item.
143:             * @return the activity created by the opening of this work item,
144:             *         <code>null</code> if the work item could not be opened.
145:             * @exception EvaluationException if an expression evaluation error
146:             *            occurs. If this exception is thrown the state of the case
147:             *            may be left inconsistent.
148:             * @exception PersistenceException if an error occours when making the
149:             *            execution of this method persistent.
150:             */
151:            public Activity open(Resource resource) throws BossaException {
152:                WFNetTransaction openTransaction = new OpenWorkItem(this ,
153:                        resource);
154:                return (Activity) getCaseType().getCaseTypeManager().getBossa()
155:                        .execute(openTransaction);
156:            }
157:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.