Source Code Cross Referenced for WorkflowInfo.java in  » ERP-CRM-Financial » Kuali-Financial-System » edu » iu » uis » eden » clientapp » 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.clientapp 
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.clientapp;
018:
019:        import java.rmi.RemoteException;
020:
021:        import org.kuali.rice.config.RiceConfigurer;
022:        import org.kuali.rice.resourceloader.GlobalResourceLoader;
023:        import org.kuali.workflow.config.KEWConfigurer;
024:
025:        import edu.iu.uis.eden.EdenConstants;
026:        import edu.iu.uis.eden.KEWServiceLocator;
027:        import edu.iu.uis.eden.clientapp.vo.ActionRequestVO;
028:        import edu.iu.uis.eden.clientapp.vo.ActionTakenVO;
029:        import edu.iu.uis.eden.clientapp.vo.DocumentContentVO;
030:        import edu.iu.uis.eden.clientapp.vo.DocumentDetailVO;
031:        import edu.iu.uis.eden.clientapp.vo.DocumentTypeVO;
032:        import edu.iu.uis.eden.clientapp.vo.ReportCriteriaVO;
033:        import edu.iu.uis.eden.clientapp.vo.RouteHeaderVO;
034:        import edu.iu.uis.eden.clientapp.vo.RouteNodeInstanceVO;
035:        import edu.iu.uis.eden.clientapp.vo.RouteTemplateEntryVO;
036:        import edu.iu.uis.eden.clientapp.vo.RuleReportCriteriaVO;
037:        import edu.iu.uis.eden.clientapp.vo.RuleVO;
038:        import edu.iu.uis.eden.clientapp.vo.UserIdVO;
039:        import edu.iu.uis.eden.clientapp.vo.UserVO;
040:        import edu.iu.uis.eden.clientapp.vo.WorkflowAttributeDefinitionVO;
041:        import edu.iu.uis.eden.clientapp.vo.WorkflowAttributeValidationErrorVO;
042:        import edu.iu.uis.eden.clientapp.vo.WorkflowGroupIdVO;
043:        import edu.iu.uis.eden.clientapp.vo.WorkgroupIdVO;
044:        import edu.iu.uis.eden.clientapp.vo.WorkgroupNameIdVO;
045:        import edu.iu.uis.eden.clientapp.vo.WorkgroupVO;
046:        import edu.iu.uis.eden.exception.InvalidWorkgroupException;
047:        import edu.iu.uis.eden.exception.WorkflowException;
048:        import edu.iu.uis.eden.server.WorkflowUtility;
049:        import edu.iu.uis.eden.util.Utilities;
050:
051:        /**
052:         * Convenience class for client applications to query workflow.  This class is one of two
053:         * (Java) client interfaces to the KEW system (the other being {@link WorkflowDocument} class).
054:         *
055:         * <p>The first time an instance of this class is created, it will read the client configuration to
056:         * determine how to connect to KEW.  To use this API, simply create a new instance using the
057:         * empty constructor.
058:         *
059:         * @author rkirkend
060:         * @author ewestfal
061:         */
062:        public class WorkflowInfo implements  java.io.Serializable {
063:
064:            private static final long serialVersionUID = 3231835171780770399L;
065:
066:            /**
067:             * Retrieves the WorkflowUtility proxy from the locator.  The locator will cache this for us.
068:             */
069:            private WorkflowUtility getWorkflowUtility()
070:                    throws WorkflowException {
071:                initializeBus();
072:                return (WorkflowUtility) GlobalResourceLoader
073:                        .getService(KEWServiceLocator.WORKFLOW_UTILITY_SERVICE);
074:            }
075:
076:            /**
077:             * Initializes the KSB configuration if it has not already been initialized by the application;
078:             * in that case only the KEW configurer is added.
079:             * @throws WorkflowException if there is an error starting the RiceConfigurer
080:             */
081:            private synchronized void initializeBus() throws WorkflowException {
082:                if (!GlobalResourceLoader.isInitialized()) {
083:                    RiceConfigurer configurer = new RiceConfigurer();
084:                    configurer
085:                            .setMessageEntity(EdenConstants.KEW_MESSAGING_ENTITY);
086:                    configurer.getModules().add(new KEWConfigurer());
087:                    try {
088:                        configurer.start();
089:                    } catch (Exception e) {
090:                        if (e instanceof  WorkflowException) {
091:                            throw (WorkflowException) e;
092:                        } else if (e instanceof  RuntimeException) {
093:                            throw (RuntimeException) e;
094:                        }
095:                        throw new WorkflowException(e);
096:                    }
097:                }
098:            }
099:
100:            /**
101:             * Returns the RouteHeaderVO of the specified document for the specified user
102:             * @param userId userId as whom to obtain the route header VO
103:             * @param routeHeaderId the id of the document whose route header VO to obtain
104:             * @return the RouteHeaderVO of the specified document for the specified user
105:             * @throws WorkflowException if an error occurs obtaining the route header VO
106:             * @see WorkflowUtility#getRouteHeaderWithUser(UserIdVO, Long)
107:             */
108:            public RouteHeaderVO getRouteHeader(UserIdVO userId,
109:                    Long routeHeaderId) throws WorkflowException {
110:                try {
111:                    return getWorkflowUtility().getRouteHeaderWithUser(userId,
112:                            routeHeaderId);
113:                } catch (Exception e) {
114:                    throw handleException(e);
115:                }
116:
117:            }
118:
119:            /**
120:             * Returns the RouteHeaderVO of the specified document
121:             * @param routeHeaderId the id of the document whose route header VO to obtain
122:             * @return the RouteHeaderVO of the specified document
123:             * @throws WorkflowException if an error occurs obtaining the route header VO
124:             * @see WorkflowUtility#getRouteHeader(Long)
125:             */
126:            public RouteHeaderVO getRouteHeader(Long documentId)
127:                    throws WorkflowException {
128:                try {
129:                    return getWorkflowUtility().getRouteHeader(documentId);
130:                } catch (Exception e) {
131:                    throw handleException(e);
132:                }
133:            }
134:
135:            /**
136:             * Returns the WorkgroupVO given a workgroup id
137:             * @param workgroupId id of the workgroup to obtain
138:             * @return the WorkgroupVO given a workgroup id
139:             * @throws WorkflowException if an error occurs obtaining the workgroup
140:             * @see WorkflowUtility#getWorkgroup(WorkgroupIdVO)
141:             */
142:            public WorkgroupVO getWorkgroup(WorkgroupIdVO workgroupId)
143:                    throws WorkflowException {
144:                try {
145:                    return getWorkflowUtility().getWorkgroup(workgroupId);
146:                } catch (Exception e) {
147:                    throw handleException(e);
148:                }
149:            }
150:
151:            /**
152:             * Returns the UserVO given a user id
153:             * @param userId id of the user to obtain
154:             * @return the UserVO given a user id
155:             * @throws WorkflowException if an error occurs obtaining the user
156:             * @see WorkflowUtility#getWorkflowUser(UserIdVO)
157:             */
158:            public UserVO getWorkflowUser(UserIdVO userId)
159:                    throws WorkflowException {
160:                try {
161:                    return getWorkflowUtility().getWorkflowUser(userId);
162:                } catch (Exception e) {
163:                    throw handleException(e);
164:                }
165:            }
166:
167:            /**
168:             * Returns the DocumentType of the document with the specified id
169:             * @param documentTypeId the id of the document whose document type we should return
170:             * @return the DocumentTypeVO of the document with the specified id
171:             * @throws WorkflowException if an error occurs obtaining the document type
172:             * @see WorkflowUtility#getDocumentType(Long)
173:             */
174:            public DocumentTypeVO getDocType(Long documentTypeId)
175:                    throws WorkflowException {
176:                try {
177:                    return getWorkflowUtility().getDocumentType(documentTypeId);
178:                } catch (Exception e) {
179:                    throw handleException(e);
180:                }
181:            }
182:
183:            /**
184:             * Returns the DocumentType of the document type with the specified name
185:             * @param documentTypeName the name of the document type whose DocumentType we should return
186:             * @return the DocumentTypeVO of the document type with the specified name
187:             * @throws WorkflowException if an error occurs obtaining the document type
188:             * @see WorkflowUtility#getDocumentTypeByName(String)
189:             */
190:            public DocumentTypeVO getDocType(String documentTypeName)
191:                    throws WorkflowException {
192:                try {
193:                    return getWorkflowUtility().getDocumentTypeByName(
194:                            documentTypeName);
195:                } catch (Exception e) {
196:                    throw handleException(e);
197:                }
198:            }
199:
200:            /**
201:             * Returns a new unique id to be used as a responsibility id
202:             * @return a new unique id to be used as a responsibility id
203:             * @throws WorkflowException if an error occurs obtaining a new responsibility id
204:             * @see WorkflowUtility#getNewResponsibilityId()
205:             */
206:            public Long getNewResponsibilityId() throws WorkflowException {
207:                try {
208:                    return getWorkflowUtility().getNewResponsibilityId();
209:                } catch (Exception e) {
210:                    throw handleException(e);
211:                }
212:            }
213:
214:            /**
215:             * Returns an array of workgroups the specified user is in.
216:             * @param userId the id of the user whose workgroups we are to return
217:             * @return an array of workgroups the specified user is in
218:             * @throws WorkflowException if an error occurs obtaining the user's workgroups
219:             * @see WorkflowUtility#getUserWorkgroups(UserIdVO)
220:             */
221:            public WorkgroupVO[] getUserWorkgroups(UserIdVO userId)
222:                    throws WorkflowException {
223:                try {
224:                    return getWorkflowUtility().getUserWorkgroups(userId);
225:                } catch (Exception e) {
226:                    throw handleException(e);
227:                }
228:            }
229:
230:            /**
231:             * Returns the pending action requests of the document of the specified id
232:             * @param routeHeaderId the id of the document whose action requests will be retrieved
233:             * @return the pending action requests of the document of the specified id
234:             * @throws WorkflowException if an error occurs obtaining the documents action requests
235:             * @see WorkflowUtility#getActionRequests(Long)
236:             */
237:            public ActionRequestVO[] getActionRequests(Long routeHeaderId)
238:                    throws WorkflowException {
239:                try {
240:                    return getWorkflowUtility()
241:                            .getActionRequests(routeHeaderId);
242:                } catch (Exception e) {
243:                    throw handleException(e);
244:                }
245:            }
246:
247:            /**
248:             * Returns the pending action requests of the document of the specified id for the specified
249:             * user and/or the specified node name.  If both user and node name are empty then will 
250:             * return all pending action requests.
251:             * @param routeHeaderId the id of the document whose action requests will be retrieved
252:             * @param nodeName the node name of the requests to be retrieved
253:             * @param userId the user that the requests would be satisfied by
254:             * @return the pending action requests of the document of the specified id
255:             * @throws WorkflowException if an error occurs obtaining the documents action requests
256:             * @see WorkflowUtility#getActionRequests(Long)
257:             */
258:            public ActionRequestVO[] getActionRequests(Long routeHeaderId,
259:                    String nodeName, UserIdVO userId) throws WorkflowException {
260:                try {
261:                    return getWorkflowUtility().getActionRequests(
262:                            routeHeaderId, nodeName, userId);
263:                } catch (Exception e) {
264:                    throw handleException(e);
265:                }
266:            }
267:
268:            /**
269:             * Returns the actions taken on the document of the specified id
270:             * @param routeHeaderId the id of the document whose actions taken will be retrieved
271:             * @return the actions taken on the document of the specified id
272:             * @throws WorkflowException if an error occurs obtaining the actions taken
273:             * @see WorkflowUtility#getActionsTaken(Long)
274:             */
275:            public ActionTakenVO[] getActionsTaken(Long routeHeaderId)
276:                    throws WorkflowException {
277:                try {
278:                    return getWorkflowUtility().getActionsTaken(routeHeaderId);
279:                } catch (Exception e) {
280:                    throw handleException(e);
281:                }
282:            }
283:
284:            /**
285:             * Returns whether the user is in the document's route log (whether an action request has been, or may be,
286:             * generated for the user)
287:             * @param routeHeaderId the id of the document to analyze
288:             * @param userId the id of the user to check
289:             * @param lookFuture whether to evaluate potential future requests
290:             * @return whether the user is in the document's route log
291:             * @throws WorkflowException if an error occurs determining whether the user is in the document's route log
292:             * @see WorkflowUtility#isUserInRouteLog(Long, UserIdVO, boolean)
293:             */
294:            public boolean isUserAuthenticatedByRouteLog(Long routeHeaderId,
295:                    UserIdVO userId, boolean lookFuture)
296:                    throws WorkflowException {
297:                try {
298:                    return getWorkflowUtility().isUserInRouteLog(routeHeaderId,
299:                            userId, lookFuture);
300:                } catch (Exception e) {
301:                    throw handleException(e);
302:                }
303:            }
304:
305:            /**
306:             * Returns whether the specified user is the final approver for the document
307:             * @param routeHeaderId the id of document to check
308:             * @param userId the id of the user to check
309:             * @return whether the specified user is the final approver for the document
310:             * @throws WorkflowException if an error occurs determining whether the user is the final approver on the document
311:             * @see WorkflowUtility#isFinalApprover(Long, UserIdVO)
312:             */
313:            public boolean isFinalApprover(Long routeHeaderId, UserIdVO userId)
314:                    throws WorkflowException {
315:                try {
316:                    return getWorkflowUtility().isFinalApprover(routeHeaderId,
317:                            userId);
318:                } catch (Exception e) {
319:                    throw handleException(e);
320:                }
321:            }
322:
323:            /**
324:             * Validate the WorkflowAttributeDefinition against it's attribute on the server.  This will validate
325:             * the inputs that will eventually become xml.
326:             *
327:             * Only applies to attributes implementing WorkflowAttributeXmlValidator.
328:             *
329:             * @param attributeDefinition the attribute definition to validate
330:             * @return WorkflowAttributeValidationErrorVO[] of error from the attribute
331:             * @throws WorkflowException when attribute doesn't implement WorkflowAttributeXmlValidator
332:             * @see WorkflowUtility#validateWorkflowAttributeDefinitionVO(WorkflowAttributeDefinitionVO)
333:             */
334:            public WorkflowAttributeValidationErrorVO[] validAttributeDefinition(
335:                    WorkflowAttributeDefinitionVO attributeDefinition)
336:                    throws WorkflowException {
337:                try {
338:                    return getWorkflowUtility()
339:                            .validateWorkflowAttributeDefinitionVO(
340:                                    attributeDefinition);
341:                } catch (Exception e) {
342:                    throw handleException(e);
343:                }
344:            }
345:
346:            /**
347:             * Helper to prevent us from needlessly wrapping a WorkflowException in another WorkflowException.
348:             */
349:            private WorkflowException handleException(Exception e) {
350:                if (e instanceof  WorkflowException) {
351:                    return (WorkflowException) e;
352:                }
353:                return new WorkflowException(e);
354:            }
355:
356:            // WORKFLOW 2.3: new methods
357:
358:            /**
359:             * Runs a "rule report" give a rule report criteria.
360:             * @param ruleReportCriteria the criteria for the rule report
361:             * @return an array of RuleVO representing rules that will fire under the specified criteria
362:             * @see WorkflowUtility#ruleReport(RuleReportCriteriaVO)
363:             */
364:            public RuleVO[] ruleReport(RuleReportCriteriaVO ruleReportCriteria)
365:                    throws WorkflowException {
366:                try {
367:                    return getWorkflowUtility().ruleReport(ruleReportCriteria);
368:                } catch (Exception e) {
369:                    throw handleException(e);
370:                }
371:            }
372:
373:            // WORKFLOW 2.1: new methods
374:
375:            /**
376:             * Returns a document detail VO representing the route header along with action requests, actions taken,
377:             * and route node instances.
378:             * @param documentId id of the document whose details should be returned
379:             * @return Returns a document detail VO representing the route header along with action requests, actions taken, and route node instances.
380:             * @throws WorkflowException
381:             * @see WorkflowUtility#getDocumentDetail(Long)
382:             */
383:            public DocumentDetailVO getDocumentDetail(Long documentId)
384:                    throws WorkflowException {
385:                try {
386:                    return getWorkflowUtility().getDocumentDetail(documentId);
387:                } catch (Exception e) {
388:                    throw handleException(e);
389:                }
390:            }
391:
392:            /**
393:             * Returns a node instance of the specified note instance id
394:             * @param nodeInstanceId the id of the node instance to return
395:             * @return a node instance of the specified note instance id
396:             * @throws WorkflowException if an error occurs obtaining the node instance
397:             * @see WorkflowUtility#getNodeInstance(Long)
398:             */
399:            public RouteNodeInstanceVO getNodeInstance(Long nodeInstanceId)
400:                    throws WorkflowException {
401:                try {
402:                    return getWorkflowUtility().getNodeInstance(nodeInstanceId);
403:                } catch (Exception e) {
404:                    throw handleException(e);
405:                }
406:            }
407:
408:            /**
409:             * Returns the route node instances that have been created so far during the life of the specified document.  This includes
410:             * all previous instances which have already been processed and are no longer active.
411:             * @param routeHeaderId the id of the document whose route node instances should be returned
412:             * @return the route node instances that have been created so far during the life of this document
413:             * @throws WorkflowException if there is an error getting the route node instances for the document
414:             * @see WorkflowUtility#getDocumentRouteNodeInstances(Long)
415:             */
416:            public RouteNodeInstanceVO[] getDocumentRouteNodeInstances(
417:                    Long routeHeaderId) throws WorkflowException {
418:                try {
419:                    return getWorkflowUtility().getDocumentRouteNodeInstances(
420:                            routeHeaderId);
421:                } catch (Exception e) {
422:                    throw handleException(e);
423:                }
424:            }
425:
426:            /**
427:             * Returns all active node instances on the document.
428:             * @param routeHeaderId id of the document whose active node instances should be returned
429:             * @return all active node instances on the document
430:             * @throws WorkflowException if there is an error obtaining the currently active nodes on the document
431:             * @see WorkflowUtility#getActiveNodeInstances(Long)
432:             */
433:            public RouteNodeInstanceVO[] getActiveNodeInstances(
434:                    Long routeHeaderId) throws WorkflowException {
435:                try {
436:                    return getWorkflowUtility().getActiveNodeInstances(
437:                            routeHeaderId);
438:                } catch (Exception e) {
439:                    throw handleException(e);
440:                }
441:            }
442:
443:            /**
444:             * Returns all node instances on the document which have no successor.
445:             * @param routeHeaderId id of the document whose terminal node instances should be returned
446:             * @return all terminal node instances of the document
447:             * @throws WorkflowException if there is an error obtaining the terminal node instances on the document
448:             * @see WorkflowUtility#getTerminalNodeInstances(Long)
449:             */
450:            public RouteNodeInstanceVO[] getTerminalNodeInstances(
451:                    Long routeHeaderId) throws WorkflowException {
452:                try {
453:                    return getWorkflowUtility().getTerminalNodeInstances(
454:                            routeHeaderId);
455:                } catch (Exception e) {
456:                    throw handleException(e);
457:                }
458:            }
459:
460:            /**
461:             * Re-resolves the specified role on the document, and refreshes any pending action requests.
462:             * @param documentTypeName the type of the document for which to re-resolve roles
463:             * @param roleName the role name to re-resolve
464:             * @param qualifiedRoleNameLabel the qualified role name label
465:             * @throws WorkflowException if an error occurs re-resolving the role
466:             * @see WorkflowUtility#reResolveRole(String, String, String)
467:             */
468:            public void reResolveRole(String documentTypeName, String roleName,
469:                    String qualifiedRoleNameLabel) throws WorkflowException {
470:                try {
471:                    getWorkflowUtility().reResolveRole(documentTypeName,
472:                            roleName, qualifiedRoleNameLabel);
473:                } catch (Exception e) {
474:                    throw handleException(e);
475:                }
476:            }
477:
478:            /**
479:             * Re-resolves the specified role on the document, and refreshes any pending action requests.
480:             * @param documentId the id of the document for which to re-resolve roles
481:             * @param roleName the role name to re-resolve
482:             * @param qualifiedRoleNameLabel the qualified role name label
483:             * @throws WorkflowException if an error occurs re-resolving the role
484:             * @see WorkflowUtility#reResolveRoleByDocumentId(Long, String, String)
485:             */
486:            public void reResolveRole(Long documentId, String roleName,
487:                    String qualifiedRoleNameLabel) throws WorkflowException {
488:                try {
489:                    getWorkflowUtility().reResolveRoleByDocumentId(documentId,
490:                            roleName, qualifiedRoleNameLabel);
491:                } catch (Exception e) {
492:                    throw handleException(e);
493:                }
494:            }
495:
496:            /**
497:             * Runs a "routing report"
498:             * @param reportCriteria routing report criteria
499:             * @return DocumentDetailVO detailing the actionrequests that would be generated under the specified criteria
500:             * @see WorkflowUtility#routingReport(ReportCriteriaVO)
501:             */
502:            public DocumentDetailVO routingReport(
503:                    ReportCriteriaVO reportCriteria) throws WorkflowException {
504:                try {
505:                    return getWorkflowUtility().routingReport(reportCriteria);
506:                } catch (Exception e) {
507:                    throw handleException(e);
508:                }
509:            }
510:
511:            /**
512:             * Returns whether the specified user is the last approver at the specified node name
513:             * @param routeHeaderId the id of document to check
514:             * @param userId the id of the user to check
515:             * @param nodeName name of node to check
516:             * @return whether the specified user is the last approver at the specified node name
517:             * @throws WorkflowException if an error occurs determining whether the user is the last approver at the specified node
518:             * @see WorkflowUtility#isLastApproverAtNode(Long, UserIdVO, String)
519:             */
520:            protected boolean isLastApproverAtNode(Long routeHeaderId,
521:                    UserIdVO userId, String nodeName) throws WorkflowException {
522:                try {
523:                    return getWorkflowUtility().isLastApproverAtNode(
524:                            routeHeaderId, userId, nodeName);
525:                } catch (Exception e) {
526:                    throw handleException(e);
527:                }
528:            }
529:
530:            /**
531:             * Returns whether the specified node on the specified document type would produce approve or complete requests
532:             * @param docType the type of the document to check
533:             * @param docContent the content to use
534:             * @param nodeName the node to check
535:             * @return whether the specified node on the specified document type would produce approve or complete requests
536:             * @throws WorkflowException if an error occurs
537:             * @see WorkflowUtility#routeNodeHasApproverActionRequest(String, String, String)
538:             */
539:            protected boolean routeNodeHasApproverActionRequest(String docType,
540:                    String docContent, String nodeName)
541:                    throws WorkflowException {
542:                try {
543:                    return getWorkflowUtility()
544:                            .routeNodeHasApproverActionRequest(docType,
545:                                    docContent, nodeName);
546:                } catch (Exception e) {
547:                    throw handleException(e);
548:                }
549:            }
550:
551:            // DEPRECATED: as of Workflow 2.0
552:
553:            /**
554:             * @deprecated use getWorkgroup(WorkgroupIdVO) instead
555:             */
556:            public WorkgroupVO getWorkgroup(String workgroupName)
557:                    throws WorkflowException {
558:                if (Utilities.isEmpty(workgroupName)) {
559:                    throw new InvalidWorkgroupException(
560:                            "Workgroup name cannot be empty");
561:                }
562:                return getWorkgroup(new WorkgroupNameIdVO(workgroupName));//getWorkflowUtility().getWorkgroup(new WorkgroupNameIdVO(workgroupName));
563:            }
564:
565:            /**
566:             * @deprecated use getWorkgroup(WorkgroupIdVO) instead
567:             */
568:            public WorkgroupVO getWorkgroup(Long workgroupId)
569:                    throws WorkflowException {
570:                if (workgroupId == null) {
571:                    throw new InvalidWorkgroupException(
572:                            "Workgroup name cannot be empty");
573:                }
574:                return getWorkgroup(new WorkflowGroupIdVO(workgroupId));
575:            }
576:
577:            /**
578:             * @deprecated use getDocType using the name
579:             */
580:            public RouteTemplateEntryVO[] getRoute(String documentTypeName)
581:                    throws WorkflowException {
582:                try {
583:                    return getWorkflowUtility().getDocRoute(documentTypeName);
584:                } catch (Exception e) {
585:                    throw handleException(e);
586:                }
587:            }
588:
589:            /**
590:             * Returns the document content VO of the specified document
591:             * @param routeHeaderId the id of the document whose content should be returned
592:             * @return the document content VO of the specified document
593:             * @throws WorkflowException if an error occurs obtaining the document content
594:             * @see WorkflowUtility#getDocumentContent(Long)
595:             */
596:            public DocumentContentVO getDocumentContent(Long routeHeaderId)
597:                    throws WorkflowException {
598:                try {
599:                    return getWorkflowUtility().getDocumentContent(
600:                            routeHeaderId);
601:                } catch (Exception e) {
602:                    throw handleException(e);
603:                }
604:            }
605:
606:            /**
607:             * Returns names of nodes already traversed
608:             * @param documentId id of the document to check
609:             * @return names of nodes already traversed
610:             * @throws RemoteException if an error occurs
611:             * @throws WorkflowException if an error occurs
612:             * @see WorkflowUtility#getPreviousRouteNodeNames(Long)
613:             * TODO: RemoteException not thrown
614:             */
615:            public String[] getPreviousRouteNodeNames(Long documentId)
616:                    throws RemoteException, WorkflowException {
617:                try {
618:                    return getWorkflowUtility().getPreviousRouteNodeNames(
619:                            documentId);
620:                } catch (Exception e) {
621:                    throw handleException(e);
622:                }
623:            }
624:
625:            /**
626:             * Checks whether a document would product at least one action request under the specified criteria
627:             * @param reportCriteriaVO criteria under which to perform the check
628:             * @param actionRequestedCodes the types of action requests to check for
629:             * @return whether a document would product at least one action request under the specified criteria
630:             * @throws WorkflowException if an error occurs
631:             * @see WorkflowUtility#documentWillHaveAtLeastOneActionRequest(ReportCriteriaVO, String[])
632:             */
633:            public boolean documentWillHaveAtLeastOneActionRequest(
634:                    ReportCriteriaVO reportCriteriaVO,
635:                    String[] actionRequestedCodes) throws WorkflowException {
636:                try {
637:                    return getWorkflowUtility()
638:                            .documentWillHaveAtLeastOneActionRequest(
639:                                    reportCriteriaVO, actionRequestedCodes);
640:                } catch (Exception e) {
641:                    throw handleException(e);
642:                }
643:            }
644:
645:            // DEPRECATED: as of Workflow 2.1
646:
647:            /**
648:             * @deprecated use {@link #isLastApproverAtNode(Long, UserIdVO, String)} instead
649:             */
650:            protected boolean isLastApproverInRouteLevel(Long routeHeaderId,
651:                    UserIdVO userId, Integer routeLevel)
652:                    throws WorkflowException {
653:                try {
654:                    return getWorkflowUtility().isLastApproverInRouteLevel(
655:                            routeHeaderId, userId, routeLevel);
656:                } catch (Exception e) {
657:                    throw handleException(e);
658:                }
659:            }
660:
661:            /**
662:             * @deprecated use {@link #routeNodeHasApproverActionRequest(String, String, String)}
663:             */
664:            protected boolean routeLevelHasApproverActionRequest(
665:                    String docType, String docContent, Integer routeLevel)
666:                    throws WorkflowException {
667:                try {
668:                    return getWorkflowUtility()
669:                            .routeLevelHasApproverActionRequest(docType,
670:                                    docContent, routeLevel);
671:                } catch (Exception e) {
672:                    throw handleException(e);
673:                }
674:            }
675:
676:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.