01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.actions;
18:
19: import edu.iu.uis.eden.EdenConstants;
20: import edu.iu.uis.eden.exception.EdenUserNotFoundException;
21: import edu.iu.uis.eden.exception.InvalidActionTakenException;
22: import edu.iu.uis.eden.exception.WorkflowException;
23: import edu.iu.uis.eden.routeheader.DocumentRouteHeaderValue;
24: import edu.iu.uis.eden.user.WorkflowUser;
25:
26: /**
27: * Does a return to previous as a superuser
28: *
29: * @author ewestfal
30: * @author rkirkend
31: */
32: public class SuperUserReturnToPreviousNodeAction extends
33: SuperUserActionTakenEvent {
34:
35: private String nodeName;
36:
37: public SuperUserReturnToPreviousNodeAction(
38: DocumentRouteHeaderValue routeHeader, WorkflowUser user) {
39: super (routeHeader, user);
40: setActionTakenCode(EdenConstants.ACTION_TAKEN_SU_RETURNED_TO_PREVIOUS_CD);
41: this .super UserAction = EdenConstants.SUPER_USER_RETURN_TO_PREVIOUS_ROUTE_LEVEL;
42: }
43:
44: public SuperUserReturnToPreviousNodeAction(
45: DocumentRouteHeaderValue routeHeader, WorkflowUser user,
46: String annotation, String nodeName) {
47: super (routeHeader, user, annotation);
48: setActionTakenCode(EdenConstants.ACTION_TAKEN_SU_RETURNED_TO_PREVIOUS_CD);
49: this .super UserAction = EdenConstants.SUPER_USER_RETURN_TO_PREVIOUS_ROUTE_LEVEL;
50: this .nodeName = nodeName;
51: }
52:
53: protected void markDocument() throws WorkflowException {
54: if (getRouteHeader().isInException()) {
55: //this.event = new DocumentRouteStatusChange(this.routeHeaderId, this.getRouteHeader().getAppDocId(), this.getRouteHeader().getDocRouteStatus(), EdenConstants.ROUTE_HEADER_ENROUTE_CD);
56: getRouteHeader().markDocumentEnroute();
57: }
58: ReturnToPreviousNodeAction returnAction = new ReturnToPreviousNodeAction(
59: getRouteHeader(), getUser(), annotation, nodeName, true);
60: returnAction.setActionTakenCode(this .getActionTakenCode());
61: returnAction.setSuperUserUsage(true);
62: returnAction.recordAction();
63: }
64:
65: protected void processActionRequests()
66: throws InvalidActionTakenException,
67: EdenUserNotFoundException {
68: //do nothing
69: }
70:
71: }
|