Source Code Cross Referenced for Task.java in  » Wiki-Engine » JSPWiki » com » ecyrd » jspwiki » workflow » 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 » Wiki Engine » JSPWiki » com.ecyrd.jspwiki.workflow 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:            JSPWiki - a JSP-based WikiWiki clone.
003:
004:            Copyright (C) 2001-2007 Janne Jalkanen (Janne.Jalkanen@iki.fi)
005:
006:            This program is free software; you can redistribute it and/or modify
007:            it under the terms of the GNU Lesser General Public License as published by
008:            the Free Software Foundation; either version 2.1 of the License, or
009:            (at your option) any later version.
010:
011:            This program is distributed in the hope that it will be useful,
012:            but WITHOUT ANY WARRANTY; without even the implied warranty of
013:            MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014:            GNU Lesser General Public License for more details.
015:
016:            You should have received a copy of the GNU Lesser General Public License
017:            along with this program; if not, write to the Free Software
018:            Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
019:         */
020:        package com.ecyrd.jspwiki.workflow;
021:
022:        import java.security.Principal;
023:
024:        /**
025:         * AbstractStep subclass that executes instructions, uninterrupted, and results
026:         * in an Outcome. Concrete classes only need to implement {@link Task#execute()}.
027:         * When the execution step completes, <code>execute</code> must return
028:         * {@link Outcome#STEP_COMPLETE}, {@link Outcome#STEP_CONTINUE} or
029:         * {@link Outcome#STEP_ABORT}. Subclasses can add any errors by calling the
030:         * helper method {@link AbstractStep#addError(String)}. The execute method should
031:         * <em>generally</em> capture and add errors to the error list instead of
032:         * throwing a WikiException.
033:         * <p>
034:         *
035:         * @author Andrew Jaquith
036:         * @since 2.5
037:         */
038:        public abstract class Task extends AbstractStep {
039:            private Step m_successor = null;
040:
041:            /**
042:             * Protected constructor that creates a new Task with a specified message key.
043:             * After construction, the protected method {@link #setWorkflow(Workflow)} should be
044:             * called.
045:             *
046:             * @param messageKey
047:             *            the Step's message key, such as
048:             *            <code>decision.editPageApproval</code>. By convention, the
049:             *            message prefix should be a lower-case version of the Step's
050:             *            type, plus a period (<em>e.g.</em>, <code>task.</code>
051:             *            and <code>decision.</code>).
052:             */
053:            public Task(String messageKey) {
054:                super (messageKey);
055:                super .addSuccessor(Outcome.STEP_COMPLETE, null);
056:                super .addSuccessor(Outcome.STEP_ABORT, null);
057:            }
058:
059:            /**
060:             * Constructs a new instance of a Task, with an associated Workflow and
061:             * message key.
062:             *
063:             * @param workflow
064:             *            the associated workflow
065:             * @param messageKey
066:             *            the i18n message key
067:             */
068:            public Task(Workflow workflow, String messageKey) {
069:                this (messageKey);
070:                setWorkflow(workflow);
071:            }
072:
073:            /**
074:             * Returns {@link SystemPrincipal#SYSTEM_USER}.
075:             * @return the system principal
076:             */
077:            public final Principal getActor() {
078:                return SystemPrincipal.SYSTEM_USER;
079:            }
080:
081:            /**
082:             * Sets the successor Step to this one, which will be triggered if the Task
083:             * completes successfully (that is, {@link Step#getOutcome()} returns
084:             * {@link Outcome#STEP_COMPLETE}. This method is really a convenient
085:             * shortcut for {@link Step#addSuccessor(Outcome, Step)}, where the first
086:             * parameter is {@link Outcome#STEP_COMPLETE}.
087:             *
088:             * @param step
089:             *            the successor
090:             */
091:            public final synchronized void setSuccessor(Step step) {
092:                m_successor = step;
093:            }
094:
095:            /**
096:             * Identifies the next Step after this Task finishes successfully. This
097:             * method will always return the value set in method
098:             * {@link #setSuccessor(Step)}, regardless of the current completion state.
099:             *
100:             * @return the next step
101:             */
102:            public final synchronized Step getSuccessor() {
103:                return m_successor;
104:            }
105:
106:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.