Source Code Cross Referenced for AdHocAction.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.ArrayList;
020:        import java.util.Iterator;
021:        import java.util.List;
022:
023:        import edu.iu.uis.eden.EdenConstants;
024:        import edu.iu.uis.eden.KEWServiceLocator;
025:        import edu.iu.uis.eden.actionrequests.ActionRequestFactory;
026:        import edu.iu.uis.eden.actionrequests.ActionRequestValue;
027:        import edu.iu.uis.eden.engine.node.RouteNodeInstance;
028:        import edu.iu.uis.eden.exception.EdenUserNotFoundException;
029:        import edu.iu.uis.eden.exception.InvalidActionTakenException;
030:        import edu.iu.uis.eden.routeheader.DocumentRouteHeaderValue;
031:        import edu.iu.uis.eden.user.Recipient;
032:        import edu.iu.uis.eden.user.WorkflowUser;
033:        import edu.iu.uis.eden.util.Utilities;
034:
035:        /**
036:         * Responsible for creating adhoc requests that are requested from the client.
037:         * 
038:         * @author rkirkend
039:         */
040:        public class AdHocAction extends ActionTakenEvent {
041:
042:            private String actionRequested;
043:            private String nodeName;
044:            private String responsibilityDesc;
045:            private Boolean ignorePrevious;
046:            private Recipient recipient;
047:            private String annotation;
048:
049:            public AdHocAction(DocumentRouteHeaderValue routeHeader,
050:                    WorkflowUser user) {
051:                super (routeHeader, user);
052:            }
053:
054:            public AdHocAction(DocumentRouteHeaderValue routeHeader,
055:                    WorkflowUser user, String annotation,
056:                    String actionRequested, String nodeName,
057:                    Recipient recipient, String responsibilityDesc,
058:                    Boolean ignorePrevActions) {
059:                super (routeHeader, user, annotation);
060:                this .actionRequested = actionRequested;
061:                this .nodeName = nodeName;
062:                this .responsibilityDesc = responsibilityDesc;
063:                this .ignorePrevious = ignorePrevActions;
064:                this .recipient = recipient;
065:                this .annotation = annotation;
066:            }
067:
068:            public void recordAction() throws InvalidActionTakenException,
069:                    EdenUserNotFoundException {
070:                List targetNodes = KEWServiceLocator.getRouteNodeService()
071:                        .getCurrentNodeInstances(getRouteHeaderId());
072:                String error = adhocRouteAction(targetNodes, false);
073:                if (!Utilities.isEmpty(error)) {
074:                    throw new InvalidActionTakenException(error);
075:                }
076:            }
077:
078:            /* (non-Javadoc)
079:             * @see edu.iu.uis.eden.actions.ActionTakenEvent#validateActionRules()
080:             */
081:            @Override
082:            public String validateActionRules()
083:                    throws EdenUserNotFoundException {
084:                List targetNodes = KEWServiceLocator.getRouteNodeService()
085:                        .getCurrentNodeInstances(getRouteHeaderId());
086:                return validateActionRules(targetNodes);
087:            }
088:
089:            private String validateActionRules(List targetNodes)
090:                    throws EdenUserNotFoundException {
091:                return adhocRouteAction(targetNodes, true);
092:            }
093:
094:            private String adhocRouteAction(List targetNodes,
095:                    boolean forValidationOnly) throws EdenUserNotFoundException {
096:                if (targetNodes.isEmpty()) {
097:                    return "Could not locate an node instance on the document with the name '"
098:                            + nodeName + "'";
099:                }
100:                boolean requestCreated = false;
101:                for (Iterator iter = targetNodes.iterator(); iter.hasNext();) {
102:                    RouteNodeInstance routeNode = (RouteNodeInstance) iter
103:                            .next();
104:                    // if the node name is null, then adhoc it to the first available node
105:                    if (nodeName == null
106:                            || routeNode.getName().equals(nodeName)) {
107:                        ActionRequestValue adhocRequest = new ActionRequestValue();
108:                        if (!forValidationOnly) {
109:                            ActionRequestFactory arFactory = new ActionRequestFactory(
110:                                    routeHeader, routeNode);
111:                            adhocRequest = arFactory.createActionRequest(
112:                                    actionRequested, recipient,
113:                                    responsibilityDesc, ignorePrevious,
114:                                    annotation);
115:                            adhocRequest
116:                                    .setResponsibilityId(EdenConstants.ADHOC_REQUEST_RESPONSIBILITY_ID);
117:                        } else {
118:                            adhocRequest.setActionRequested(actionRequested);
119:                        }
120:                        if (adhocRequest.isApproveOrCompleteRequest()
121:                                && !(routeHeader.isEnroute()
122:                                        || routeHeader.isStateInitiated() || routeHeader
123:                                        .isStateSaved())) {
124:                            return "Cannot AdHoc a Complete or Approve request when document is in state '"
125:                                    + routeHeader.getDocRouteStatusLabel()
126:                                    + "'.";
127:                        }
128:                        if (!forValidationOnly) {
129:                            if (routeHeader.isDisaproved()
130:                                    || routeHeader.isFinal()
131:                                    || routeHeader.isProcessed()) {
132:                                getActionRequestService().activateRequest(
133:                                        adhocRequest);
134:                            } else {
135:                                KEWServiceLocator.getActionRequestService()
136:                                        .saveActionRequest(adhocRequest);
137:                            }
138:                        }
139:                        requestCreated = true;
140:                        if (nodeName == null) {
141:                            break;
142:                        }
143:                    }
144:                }
145:                if (!requestCreated) {
146:                    return "Didn't create request.  The node name " + nodeName
147:                            + " given is probably invalid ";
148:                }
149:                return "";
150:            }
151:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.