001/* 002 * (C) Copyright 2013 Nuxeo SA (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Mariana Cedica 016 */ 017package org.nuxeo.ecm.platform.routing.core.api; 018 019import java.util.List; 020 021import org.nuxeo.ecm.core.api.CoreSession; 022import org.nuxeo.ecm.platform.routing.core.impl.GraphNode; 023import org.nuxeo.ecm.platform.routing.core.impl.GraphNode.EscalationRule; 024 025/** 026 * @since 5.7.2 027 */ 028public interface DocumentRoutingEscalationService { 029 030 /** 031 * Query all running workflows and returns a list of nodes that are suspended and have escalation rules that can be 032 * inspected. Uses an unrestricted session. 033 * 034 * @return 035 * @since 5.7.2 036 */ 037 List<String> queryForSuspendedNodesWithEscalation(CoreSession session); 038 039 /** 040 * Computes the list of escalation rules to be executed after their conditions are evaluated for the given node. 041 * 042 * @return 043 * @since 5.7.2 044 */ 045 public List<EscalationRule> computeEscalationRulesToExecute(GraphNode node); 046 047 /** 048 * Schedules for execution an escalation rule. Uses an unrestricted session. 049 * 050 * @param rule 051 * @since 5.7.2 052 */ 053 void scheduleExecution(EscalationRule rule, CoreSession session); 054}