001 /**
002 * Copyright 2005-2012 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.kew.engine;
017
018 import org.kuali.rice.kew.actiontaken.ActionTakenValue;
019 import org.kuali.rice.kew.api.KewApiConstants;
020
021 import java.util.Collections;
022 import java.util.HashSet;
023 import java.util.Set;
024
025
026 /**
027 * Specifies configuration for orchestration through the engine.
028 *
029 * @author Kuali Rice Team (rice.collab@kuali.org)
030 */
031 public class OrchestrationConfig {
032
033 public enum EngineCapability { STANDARD, BLANKET_APPROVAL, SIMULATION }
034
035 private final EngineCapability capability;
036 private final boolean sendNotifications;
037 private final String notificationType = KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ;
038 private final Set<String> destinationNodeNames;
039 private final ActionTakenValue cause;
040 private final boolean runPostProcessorLogic;
041
042 public OrchestrationConfig(EngineCapability capability) {
043 this(capability, Collections.<String>emptySet(), null, true, true);
044 }
045
046 public OrchestrationConfig(EngineCapability capability, boolean isRunPostProcessorLogic) {
047 this(capability, Collections.<String>emptySet(), null, true, isRunPostProcessorLogic);
048 }
049
050 public OrchestrationConfig(EngineCapability capability, Set<String> destinationNodeNames, ActionTakenValue cause) {
051 this(capability, destinationNodeNames, cause, true, true);
052 }
053
054 public OrchestrationConfig(EngineCapability capability, Set<String> destinationNodeNames, ActionTakenValue cause, boolean sendNotifications, boolean doRunPostProcessorLogic) {
055 this.capability = capability;
056 this.destinationNodeNames = Collections.unmodifiableSet(new HashSet<String>(destinationNodeNames));
057 this.cause = cause;
058 this.sendNotifications = sendNotifications;
059 this.runPostProcessorLogic = doRunPostProcessorLogic;
060 }
061
062 public Set<String> getDestinationNodeNames() {
063 return destinationNodeNames;
064 }
065
066 public String getNotificationType() {
067 return notificationType;
068 }
069
070 public boolean isSendNotifications() {
071 return sendNotifications;
072 }
073
074 public ActionTakenValue getCause() {
075 return cause;
076 }
077
078 public boolean isRunPostProcessorLogic() {
079 return this.runPostProcessorLogic;
080 }
081
082 /**
083 * @return the capability
084 */
085 public EngineCapability getCapability() {
086 return this.capability;
087 }
088
089 }