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.node;
017
018 import java.util.ArrayList;
019 import java.util.List;
020
021 import org.kuali.rice.kew.actionitem.ActionItem;
022 import org.kuali.rice.kew.actionrequest.ActionRequestValue;
023 import org.kuali.rice.kew.actionrequest.service.impl.NotificationSuppression;
024 import org.kuali.rice.kew.engine.RouteContext;
025 import org.kuali.rice.kew.service.KEWServiceLocator;
026
027 /**
028 * Abstract superclass for request activation node types
029 *
030 * @author Kuali Rice Team (rice.collab@kuali.org)
031 *
032 */
033 public abstract class RequestActivationNodeBase implements SimpleNode {
034
035 /**
036 *
037 * <p>This method takes care of notification for ActionItemS. It has logic for suppressing notifications a)
038 * during simulations, and b) when the RouteNodeInstance has NodeState specifically hinting for notification
039 * suppression for a given ActionItem.
040 *
041 * <p>A side effect during non-simulation calls is that any notification suppression NodeStateS will be removed
042 * from the RouteNodeInstance after notifications are sent.
043 *
044 * @param context
045 * @param actionItems
046 * @param actionRequests
047 * @param routeNodeInstance
048 */
049 protected void notify(RouteContext context, List<ActionItem> actionItems, RouteNodeInstance routeNodeInstance) {
050
051 if (!context.isSimulation()) {
052 new NotificationSuppression().notify(actionItems, routeNodeInstance);
053 }
054 }
055
056 }