Source Code Cross Referenced for RouteDocumentAction.java in  » ERP-CRM-Financial » Kuali-Financial-System » edu » iu » uis » eden » actions » 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 » ERP CRM Financial » Kuali Financial System » edu.iu.uis.eden.actions 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005-2006 The Kuali Foundation.
003:         *
004:         *
005:         * Licensed under the Educational Community License, Version 1.0 (the "License");
006:         * you may not use this file except in compliance with the License.
007:         * You may obtain a copy of the License at
008:         *
009:         * http://www.opensource.org/licenses/ecl1.php
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package edu.iu.uis.eden.actions;
018:
019:        import java.util.Iterator;
020:        import java.util.List;
021:
022:        import org.apache.log4j.MDC;
023:
024:        import edu.iu.uis.eden.EdenConstants;
025:        import edu.iu.uis.eden.actionrequests.ActionRequestValue;
026:        import edu.iu.uis.eden.exception.EdenUserNotFoundException;
027:        import edu.iu.uis.eden.exception.InvalidActionTakenException;
028:        import edu.iu.uis.eden.exception.WorkflowException;
029:        import edu.iu.uis.eden.routeheader.DocumentRouteHeaderValue;
030:        import edu.iu.uis.eden.user.WorkflowUser;
031:        import edu.iu.uis.eden.util.Utilities;
032:
033:        /**
034:         * Action that puts the document in routing.
035:         *
036:         * @author rkirkend
037:         * @author ewestfal
038:         * @author seiffert
039:         *
040:         */
041:        public class RouteDocumentAction extends ActionTakenEvent {
042:            private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger
043:                    .getLogger(RouteDocumentAction.class);
044:
045:            public RouteDocumentAction(DocumentRouteHeaderValue rh,
046:                    WorkflowUser user) {
047:                super (rh, user);
048:                setActionTakenCode(EdenConstants.ACTION_TAKEN_COMPLETED_CD);
049:            }
050:
051:            public RouteDocumentAction(DocumentRouteHeaderValue rh,
052:                    WorkflowUser user, String annotation) {
053:                super (rh, user, annotation);
054:                setActionTakenCode(EdenConstants.ACTION_TAKEN_COMPLETED_CD);
055:            }
056:
057:            /* (non-Javadoc)
058:             * @see edu.iu.uis.eden.actions.ActionTakenEvent#getActionPerformedCode()
059:             */
060:            @Override
061:            public String getActionPerformedCode() {
062:                return EdenConstants.ACTION_TAKEN_ROUTED_CD;
063:            }
064:
065:            /* (non-Javadoc)
066:             * @see edu.iu.uis.eden.actions.ActionTakenEvent#requireInitiatorCheck()
067:             */
068:            @Override
069:            protected boolean requireInitiatorCheck() {
070:                return routeHeader.getDocumentType()
071:                        .getInitiatorMustRoutePolicy().getPolicyValue()
072:                        .booleanValue();
073:            }
074:
075:            /* (non-Javadoc)
076:             * @see edu.iu.uis.eden.actions.ActionTakenEvent#isActionCompatibleRequest(java.util.List)
077:             */
078:            @Override
079:            public String validateActionRules()
080:                    throws EdenUserNotFoundException {
081:                String super Error = super .validateActionTakenRules();
082:                if (!Utilities.isEmpty(super Error)) {
083:                    return super Error;
084:                }
085:                if (!getRouteHeader().isValidActionToTake(
086:                        getActionPerformedCode())) {
087:                    return "Document is not in a state to be routed";
088:                }
089:                return "";
090:            }
091:
092:            /**
093:             * Record the routing action. To route a document, it must be in the proper state. Previous requests and actions have no bearing on the outcome of this action, unless the
094:             * @throws edu.iu.uis.eden.exception.InvalidActionTakenException
095:             * @throws edu.iu.uis.eden.exception.EdenUserNotFoundException
096:             */
097:            public void recordAction()
098:                    throws edu.iu.uis.eden.exception.InvalidActionTakenException,
099:                    EdenUserNotFoundException {
100:                MDC.put("docId", getRouteHeader().getRouteHeaderId());
101:                checkLocking();
102:                updateSearchableAttributesIfPossible();
103:                //        if (routeHeader.getDocumentType().getInitiatorMustRoutePolicy().getPolicyValue().booleanValue()) {
104:                //            super.recordAction();
105:                //        }
106:
107:                if (annotation == null) {
108:                    annotation = "";
109:                }
110:
111:                LOG.debug("Routing document : " + annotation);
112:
113:                LOG.debug("Checking to see if the action is legal");
114:                String errorMessage = validateActionRules();
115:                if (!Utilities.isEmpty(errorMessage)) {
116:                    throw new InvalidActionTakenException(errorMessage);
117:                }
118:
119:                // we want to check that the "RouteDocument" command is valid here, not the "Complete" command (which is in our Action's action taken code)
120:                //        if (getRouteHeader().isValidActionToTake(EdenConstants.ACTION_TAKEN_ROUTED_CD)) {
121:                LOG.debug("Record the routing action");
122:                saveActionTaken();
123:
124:                //TODO this will get all pending AR's even if they haven't been in an action list... This seems bad
125:                List actionRequests = getActionRequestService()
126:                        .findPendingByDoc(getRouteHeaderId());
127:                LOG.debug("Deactivate all pending action requests");
128:                // deactivate any requests for the user that routed the document.
129:                for (Iterator iter = actionRequests.iterator(); iter.hasNext();) {
130:                    ActionRequestValue actionRequest = (ActionRequestValue) iter
131:                            .next();
132:                    // requests generated to the user who is routing the document should be deactivated
133:                    if ((getUser().getWorkflowId().equals(actionRequest
134:                            .getWorkflowId()))
135:                            && (actionRequest.isActive())) {
136:                        getActionRequestService().deactivateRequest(
137:                                actionTaken, actionRequest);
138:                    }
139:                    // requests generated by a save action should be deactivated
140:                    else if (EdenConstants.SAVED_REQUEST_RESPONSIBILITY_ID
141:                            .equals(actionRequest.getResponsibilityId())) {
142:                        getActionRequestService().deactivateRequest(
143:                                actionTaken, actionRequest);
144:                    }
145:                }
146:
147:                try {
148:                    String oldStatus = getRouteHeader().getDocRouteStatus();
149:                    getRouteHeader().markDocumentEnroute();
150:                    getRouteHeader().setRoutedByUserWorkflowId(
151:                            getUser().getWorkflowId());
152:
153:                    String newStatus = getRouteHeader().getDocRouteStatus();
154:                    notifyStatusChange(newStatus, oldStatus);
155:                    getRouteHeaderService().saveRouteHeader(getRouteHeader());
156:                } catch (WorkflowException ex) {
157:                    LOG.warn(ex, ex);
158:                    throw new InvalidActionTakenException(ex.getMessage());
159:                }
160:                //        } else {
161:                //            LOG.warn("Document not in state to be routed.");
162:                //            throw new InvalidActionTakenException("Document is not in a state to be routed");
163:                //        }
164:            }
165:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.