Source Code Cross Referenced for SmartWfProcess.java in  » Workflow-Engines » wfmopen-2.1.1 » process » 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 » wfmopen 2.1.1 » process 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package process;
002:
003:        import java.util.ArrayList;
004:        import java.util.Collection;
005:        import java.util.Iterator;
006:
007:        import java.rmi.RemoteException;
008:
009:        import de.danet.an.workflow.omgcore.AlreadyRunningException;
010:        import de.danet.an.workflow.omgcore.CannotStartException;
011:        import de.danet.an.workflow.omgcore.InvalidStateException;
012:        import de.danet.an.workflow.omgcore.TransitionNotAllowedException;
013:        import de.danet.an.workflow.omgcore.WfActivity;
014:        import de.danet.an.workflow.omgcore.WfProcess;
015:
016:        /**
017:         * Describe class <code>SmartWfProcess</code> here.
018:         *
019:         * @author <a href="mailto:weidauer@danet.de">Christian Weidauer</a>
020:         * @version 1.0
021:         */
022:        public class SmartWfProcess extends SmartWfExecutionObject {
023:
024:            /**
025:             * Describe variable <code>returnSmartActivities</code> here.
026:             *
027:             */
028:            protected boolean returnSmartActivities = true;
029:
030:            /**
031:             * Creates a new <code>SmartWfProcess</code> instance.
032:             *
033:             * @param wfp a <code>WfProcess</code> value
034:             * @param setStateDirectly a <code>boolean</code> value
035:             * @param returnSmartActivities a <code>boolean</code> value
036:             */
037:            public SmartWfProcess(WfProcess wfp, boolean setStateDirectly,
038:                    boolean returnSmartActivities) throws Exception {
039:                super (wfp, setStateDirectly);
040:                this .returnSmartActivities = returnSmartActivities;
041:            }
042:
043:            /**
044:             * Creates a new <code>SmartWfProcess</code> instance.
045:             *
046:             * @param wfp a <code>WfProcess</code> value
047:             * @param setStateDirectly a <code>boolean</code> value
048:             */
049:            public SmartWfProcess(WfProcess wfp, boolean setStateDirectly)
050:                    throws Exception {
051:                super (wfp, setStateDirectly);
052:            }
053:
054:            /**
055:             * Creates a new <code>SmartWfProcess</code> instance.
056:             *
057:             * @param wfp a <code>WfProcess</code> value
058:             */
059:            public SmartWfProcess(WfProcess wfp) throws Exception {
060:                super (wfp, false);
061:            }
062:
063:            /**
064:             * Sets the state of a WfProcess object by calling  
065:             * start() (setStateDirectly == false) or by calling  
066:             * setState() (setStateDirectly == true). 
067:             * The intended transition is from open.not_running.not_started to 
068:             * open.running.
069:             * @exception RemoteException if an error occurs
070:             * @exception CannotStartException if an error occurs
071:             * @exception AlreadyRunningException if an error occurs
072:             * @exception InvalidStateException if an error occurs
073:             * @exception TransitionNotAllowedException if an error occurs
074:             */
075:            public void start() throws RemoteException, CannotStartException,
076:                    AlreadyRunningException, InvalidStateException,
077:                    TransitionNotAllowedException {
078:                boolean remoteExceptionCaught = false;
079:                do {
080:                    remoteExceptionCaught = false;
081:                    try {
082:                        if (setStateDirectly) {
083:                            wfeo.changeState("open.running");
084:                        } else {
085:                            ((WfProcess) wfeo).start();
086:                        }
087:                    } catch (RemoteException re) {
088:                        remoteExceptionCaught = true;
089:                    }
090:                } while (remoteExceptionCaught);
091:            }
092:
093:            /**
094:             * Describe <code>activitiesInState</code> method here.
095:             *
096:             * @param state a <code>String</code> value
097:             * @return a <code>Collection</code> value
098:             * @exception Exception if an error occurs
099:             */
100:            public Collection activitiesInState(String state) throws Exception {
101:                Collection activities = null;
102:                boolean remoteExceptionCaught = false;
103:                do {
104:                    remoteExceptionCaught = false;
105:                    try {
106:                        activities = ((WfProcess) wfeo)
107:                                .activitiesInState(state);
108:                    } catch (RemoteException re) {
109:                        remoteExceptionCaught = true;
110:                    }
111:                } while (remoteExceptionCaught);
112:                if (returnSmartActivities) {
113:                    activities = makeSmart(activities);
114:                }
115:                return activities;
116:            }
117:
118:            /**
119:             * Describe <code>steps</code> method here.
120:             *
121:             * @return a <code>Collection</code> value
122:             * @exception Exception if an error occurs
123:             */
124:            public Collection steps() throws Exception {
125:                Collection steps = null;
126:                boolean remoteExceptionCaught = false;
127:                do {
128:                    remoteExceptionCaught = false;
129:                    try {
130:                        steps = ((WfProcess) wfeo).steps();
131:                    } catch (RemoteException re) {
132:                        remoteExceptionCaught = true;
133:                    }
134:                } while (remoteExceptionCaught);
135:                if (returnSmartActivities) {
136:                    steps = makeSmart(steps);
137:                }
138:                return steps;
139:            }
140:
141:            /**
142:             * Describe <code>getWfProcess</code> method here.
143:             *
144:             * @return a <code>WfProcess</code> value
145:             */
146:            public WfProcess getWfProcess() {
147:                return (WfProcess) wfeo;
148:            }
149:
150:            /**
151:             * Describe <code>makeSmart</code> method here.
152:             *
153:             * @param activityCollection a <code>Collection</code> value
154:             * @return a <code>Collection</code> value
155:             */
156:            protected Collection makeSmart(Collection activityCollection)
157:                    throws Exception {
158:                Collection newCollection = new ArrayList();
159:                Iterator it = activityCollection.iterator();
160:                while (it.hasNext()) {
161:                    WfActivity activity = (WfActivity) it.next();
162:                    newCollection.add(new SmartWfActivity(activity,
163:                            setStateDirectly));
164:                }
165:                return newCollection;
166:            }
167:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.