001/* 002 * (C) Copyright 2011 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 * Nuxeo - initial API and implementation 016 */ 017package org.nuxeo.ecm.platform.routing.api.operation; 018 019import org.nuxeo.ecm.automation.OperationContext; 020import org.nuxeo.ecm.automation.core.annotations.Context; 021import org.nuxeo.ecm.automation.core.annotations.Operation; 022import org.nuxeo.ecm.automation.core.annotations.OperationMethod; 023import org.nuxeo.ecm.automation.core.annotations.Param; 024import org.nuxeo.ecm.core.api.CoreSession; 025import org.nuxeo.ecm.platform.routing.api.DocumentRouteStep; 026import org.nuxeo.ecm.platform.routing.api.DocumentRoutingConstants; 027import org.nuxeo.ecm.platform.routing.api.helper.ConditionalFolderUpdateRunner; 028 029/*** 030 * Set the position of the child to be run once the step with the given id it's finished. 031 * 032 * @since 5.5 033 * @deprecated since 5.9.2 - Use only routes of type 'graph' 034 */ 035@Deprecated 036@Operation(id = SetNextStepOnConditionalFolderOperation.ID, category = DocumentRoutingConstants.OPERATION_CATEGORY_ROUTING_NAME, label = "Choose branch", description = "Update branch to be executed ", addToStudio = false) 037public class SetNextStepOnConditionalFolderOperation { 038 039 public static final String ID = "Update.NextStep.ConditionalFolder"; 040 041 @Param(name = "nextStepPos", required = true) 042 protected String nextStepPos; 043 044 @Context 045 protected OperationContext context; 046 047 @Context 048 protected CoreSession session; 049 050 @OperationMethod 051 public void setStepToBeExcutedNext() { 052 DocumentRouteStep step = (DocumentRouteStep) context.get(DocumentRoutingConstants.OPERATION_STEP_DOCUMENT_KEY); 053 ConditionalFolderUpdateRunner condFolderUpdater = new ConditionalFolderUpdateRunner(step.getDocument().getId()); 054 condFolderUpdater.setStepToBeExecutedNext(session, nextStepPos); 055 } 056}