Coverage Report - org.kuali.rice.kew.api.action.ActionType
 
Classes in this File Line Coverage Branch Coverage Complexity
ActionType
0%
0/41
0%
0/8
2.6
 
 1  
 /*
 2  
  * Copyright 2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl1.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kew.api.action;
 17  
 
 18  
 import javax.xml.bind.annotation.XmlEnum;
 19  
 import javax.xml.bind.annotation.XmlEnumValue;
 20  
 import javax.xml.bind.annotation.XmlRootElement;
 21  
 import javax.xml.bind.annotation.XmlType;
 22  
 
 23  
 import org.kuali.rice.core.api.mo.common.Coded;
 24  
 
 25  
 /**
 26  
  * TODO...
 27  
  * 
 28  
  * @author ewestfal
 29  
  *
 30  
  */
 31  0
 @XmlRootElement(name = "actionType")
 32  
 @XmlType(name = "ActionTypeType")
 33  
 @XmlEnum
 34  
 public enum ActionType implements Coded {
 35  
 
 36  0
     @XmlEnumValue("k") SU_ACKNOWLEDGE("k", "SUPER USER ACKNOWLEDGE"),
 37  
     
 38  0
     @XmlEnumValue("f") SU_FYI("f", "SUPER USER FYI"),
 39  
     
 40  0
     @XmlEnumValue("m") SU_COMPLETE("m", "SUPER USER COMPLETE"),
 41  
     
 42  0
     @XmlEnumValue("v") SU_APPROVE("v", "SUPER USER APPROVE"),
 43  
     
 44  0
     @XmlEnumValue("r") SU_ROUTE_NODE_APPROVE("r", "SUPER USER ROUTE NODE APPROVE"),
 45  
     
 46  0
     @XmlEnumValue("z") SU_RETURN_TO_PREVIOUS("z", "SUPER USER RETURN TO PREVIOUS"),
 47  
     
 48  0
     @XmlEnumValue("d") SU_DISAPPROVE("d", "SUPER USER DISAPPROVE"),
 49  
     
 50  0
     @XmlEnumValue("c") SU_CANCEL("c", "SUPER USER CANCEL"),
 51  
     
 52  0
     @XmlEnumValue("a") SU_BLANKET_APPROVE("a", "SUPER USER BLANKET APPROVE"),
 53  
     
 54  0
     @XmlEnumValue("B") BLANKET_APPROVE("B", "BLANKET APPROVE"),
 55  
     
 56  0
     @XmlEnumValue("F") FYI("F", "FYI"),
 57  
     
 58  
     /**
 59  
      * User has generated an action request to another user
 60  
      */
 61  0
     @XmlEnumValue("H") ADHOC_REQUEST("H", "ADHOC REQUEST"),
 62  
     
 63  
     /**
 64  
      * AdHoc Request has been revoked
 65  
      */
 66  0
     @XmlEnumValue("V") ADHOC_REQUEST_REVOKE("V", "ADHOC REQUEST_REVOKE"),
 67  
     
 68  
     /**
 69  
      * Document has been saved by the user for later work
 70  
      */
 71  0
     @XmlEnumValue("S") SAVE("S", "SAVED"),
 72  
     
 73  
     /**
 74  
      * Document has been canceled.
 75  
      */
 76  0
     @XmlEnumValue("X") CANCEL("X", "CANCEL"),
 77  
     
 78  
     /**
 79  
      * Document has been disapproved.
 80  
      */
 81  0
     @XmlEnumValue("D") DISAPPROVE("D", "DISAPPROVE"),
 82  
     
 83  
     /**
 84  
      * Document has been opened by the designated recipient.
 85  
      */
 86  0
     @XmlEnumValue("K") ACKNOWLEDGE("K", "ACKNOWLEDGE"),
 87  
     
 88  
     /**
 89  
      * Document has been completed as requested.
 90  
      */
 91  0
     @XmlEnumValue("C") COMPLETE("C", "COMPLETE"),
 92  
     
 93  
     /**
 94  
      * Document has been submitted to the engine for processing.
 95  
      */
 96  0
     @XmlEnumValue("O") ROUTE("O", "ROUTE"),
 97  
     
 98  
     /**
 99  
      * The document has been approved.
 100  
      */
 101  0
     @XmlEnumValue("A") APPROVE("A", "APPROVE"),
 102  
     
 103  
     /**
 104  
      * The document is being returned to a previous routelevel
 105  
      */
 106  0
     @XmlEnumValue("Z") RETURN_TO_PREVIOUS("Z", "RETURN TO PREVIOUS"),
 107  
     
 108  
     /**
 109  
      * The document has non-routed activity against it that is recorded in the route log
 110  
      */
 111  0
     @XmlEnumValue("R") LOG_MESSAGE("R", "LOG MESSAGE"),
 112  
     
 113  
     /**
 114  
      * The document is routed to a workgroup and a user in the workgroup wants to take authority from the workgroup
 115  
      */
 116  0
     @XmlEnumValue("w") TAKE_GROUP_AUTHORITY("w", "TAKE GROUP AUTHORITY"),
 117  
                     
 118  
     /**
 119  
      * The person who took workgroup authority is releasing it
 120  
      */
 121  0
     @XmlEnumValue("y") RELEASE_GROUP_AUTHORITY("y", "RELEASE GROUP AUTHORITY"),
 122  
     
 123  
     /**
 124  
      * The document is moved
 125  
      */
 126  0
     @XmlEnumValue("M") MOVE("M", "MOVED");
 127  
 
 128  
         private final String code;
 129  
         private final String label;
 130  
         
 131  0
         private ActionType(String code, String label) {
 132  0
                 this.code = code;
 133  0
                 this.label = label;
 134  0
         }
 135  
         
 136  
         @Override
 137  
         public String getCode() {
 138  0
                 return code;
 139  
         }
 140  
         
 141  
         public String getLabel() {
 142  0
                 return label;
 143  
         }
 144  
         
 145  
         public static ActionType fromCode(String code) {
 146  0
                 return fromCode(code, false);
 147  
         }
 148  
         
 149  
         public static ActionType fromCode(String code, boolean allowMissing) {
 150  0
                 if (code == null) {
 151  0
                         return null;
 152  
                 }
 153  0
                 for (ActionType status : values()) {
 154  0
                         if (status.code.equals(code)) {
 155  0
                                 return status;
 156  
                         }
 157  
                 }
 158  0
                 if (allowMissing) {
 159  0
                         return null;
 160  
                 }
 161  0
                 throw new IllegalArgumentException("Failed to locate the ActionType with the given code: " + code);
 162  
         }
 163  
         
 164  
 }