package com.capgemini.reports.execution.actions;

import com.capgemini.framework.teamcenter.authent.TcSession;
import com.capgemini.framework.teamcenter.exceptions.KurtException;
import com.capgemini.reports.database.javabean.DbReport;
import com.capgemini.reports.exceptions.InvalidUserInputException;
import com.capgemini.reports.execution.AbstractExecutionReport;

import java.io.Serializable;

/** Interface for an action to be taken right before a report begins its execution. */
public interface IPreExecutionStep extends Serializable {

    /**
     * The action to perform before the report execution.
     * 
     * @param session a Teamcenter session (active)
     * @param report the report which has just finished printing
     * @param dbReport the Db object
     * @param <T> the type of report which failed
     * @throws KurtException anything that happens must be a {@link KurtException} so it can be caught and dealt with appropriately. <br>
     *         Particularly, if the error is a functional error, do throw an {@link InvalidUserInputException}
     */
    <T extends AbstractExecutionReport<T, ?>> void performPreAction(T report, DbReport dbReport, TcSession session) throws KurtException;

}
