Coverage Report - org.kuali.rice.kew.engine.OrchestrationConfig
 
Classes in this File Line Coverage Branch Coverage Complexity
OrchestrationConfig
68%
15/22
50%
1/2
1.1
OrchestrationConfig$EngineCapability
100%
1/1
N/A
1.1
 
 1  
 /*
 2  
  * Copyright 2005-2007 The Kuali Foundation
 3  
  * 
 4  
  * 
 5  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  * 
 9  
  * http://www.opensource.org/licenses/ecl2.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 org.kuali.rice.kew.engine;
 18  
 
 19  
 import org.kuali.rice.kew.actiontaken.ActionTakenValue;
 20  
 import org.kuali.rice.kew.util.KEWConstants;
 21  
 
 22  
 import java.util.Collections;
 23  
 import java.util.HashSet;
 24  
 import java.util.Set;
 25  
 
 26  
 
 27  
 /**
 28  
  * Specifies configuration for orchestration through the engine.
 29  
  * 
 30  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 31  
  */
 32  
 public class OrchestrationConfig {
 33  
 
 34  5
     public enum EngineCapability { STANDARD, BLANKET_APPROVAL, SIMULATION };
 35  
     
 36  
     private final EngineCapability capability;
 37  
     private final boolean sendNotifications;
 38  5
     private final String notificationType = KEWConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ;
 39  
     private final Set<String> destinationNodeNames;
 40  
     private final ActionTakenValue cause;
 41  
     private final boolean runPostProcessorLogic;
 42  
     
 43  
     public OrchestrationConfig(EngineCapability capability) {
 44  3
         this(capability, null, null, true, true);
 45  3
     }
 46  
     
 47  
     public OrchestrationConfig(EngineCapability capability, boolean isRunPostProcessorLogic) {
 48  2
         this(capability, null, null, true, isRunPostProcessorLogic);
 49  2
     }
 50  
     
 51  
     public OrchestrationConfig(EngineCapability capability, Set<String> destinationNodeNames, ActionTakenValue cause) {
 52  0
         this(capability, destinationNodeNames, cause, true, true);
 53  0
     }
 54  
     
 55  5
     public OrchestrationConfig(EngineCapability capability, Set<String> destinationNodeNames, ActionTakenValue cause, boolean sendNotifications, boolean doRunPostProcessorLogic) {
 56  5
         this.capability = capability;
 57  5
         if (destinationNodeNames != null)
 58  0
             this.destinationNodeNames = Collections.unmodifiableSet(destinationNodeNames);
 59  
         else 
 60  5
             this.destinationNodeNames = Collections.unmodifiableSet(new HashSet<String>());
 61  5
         this.cause = cause;
 62  5
         this.sendNotifications = sendNotifications;
 63  5
         this.runPostProcessorLogic = doRunPostProcessorLogic;
 64  5
     }
 65  
     
 66  
     public Set<? extends String> getDestinationNodeNames() {
 67  0
         return destinationNodeNames;
 68  
     }
 69  
 
 70  
     public String getNotificationType() {
 71  0
         return notificationType;
 72  
     }
 73  
 
 74  
     public boolean isSendNotifications() {
 75  0
         return sendNotifications;
 76  
     }
 77  
 
 78  
     public ActionTakenValue getCause() {
 79  0
         return cause;
 80  
     }
 81  
 
 82  
         public boolean isRunPostProcessorLogic() {
 83  2
                 return this.runPostProcessorLogic;
 84  
         }
 85  
 
 86  
     /**
 87  
      * @return the capability
 88  
      */
 89  
     public EngineCapability getCapability() {
 90  5
         return this.capability;
 91  
     }    
 92  
     
 93  
 }