package org.splat.service;
+import java.io.IOException;
import java.util.List;
import org.splat.dal.bo.kernel.User;
import org.splat.dal.bo.som.SimulationContext;
import org.splat.dal.bo.som.Study;
import org.splat.kernel.InvalidPropertyException;
+import org.splat.kernel.MismatchException;
import org.splat.kernel.MissedPropertyException;
import org.splat.kernel.MultiplyDefinedException;
+import org.splat.kernel.NotApplicableException;
import org.splat.service.dto.StepDTO;
import org.splat.som.Step;
InvalidPropertyException, MultiplyDefinedException;
/**
- * Check-in the scenario after SALOME session.
+ * Check-in the scenario after SALOME session. If a document to be checked in already exists then create a new version of it. Otherwise
+ * create a new document of the appropriate step result type.
+ * <ul>
+ * <li>For each new created document version we copy Uses relations from the previous document version. If used document has been also
+ * versioned during this check-in operation then refer to its new version.</li>
+ * <li>For each new document create uses relation to the last versions of results of a previous step.</li>
+ * </ul>
+ * <b>NOTE:</b> Only the first attached file is processed for each document. <br/>All new documents/versions are created in inWORK
+ * state.
*
* @param scenId
* the scenario id
* the id of the user who modified documents
* @param scInfo
* the list of scenario steps DTO
+ * @throws InvalidPropertyException
+ * if the scenario hasn't some of given steps or documents
+ * @throws IOException
+ * if a file can't be moved into the vault
+ * @throws MismatchException
+ * if version creation in some of steps is failed
+ * @throws MissedPropertyException
+ * if some mandatory property is missed when new document or new document version is created
+ * @throws MultiplyDefinedException
+ * if some property is defined several times when new document or new document version is created
+ * @throws NotApplicableException
+ * if failed saving of a new publication with a given state
*/
void checkin(final long scenId, final long userId,
- final List<StepDTO> scInfo);
+ final List<StepDTO> scInfo) throws InvalidPropertyException,
+ MissedPropertyException, MultiplyDefinedException,
+ MismatchException, IOException, NotApplicableException;
/**
* Check in the scenario.