Salome HOME
Creation of a new study is fixed. Database.getSessoin is not used now during creation...
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / ScenarioService.java
1 /*****************************************************************************
2  * Company         EURIWARE
3  * Application     SIMAN
4  * File            $Id$ 
5  * Creation date   06.10.2012
6  * @author         $Author$
7  * @version        $Revision$
8  *****************************************************************************/
9
10 package org.splat.service;
11
12 import org.splat.dal.bo.som.KnowledgeElement;
13 import org.splat.dal.bo.som.Scenario;
14 import org.splat.kernel.InvalidPropertyException;
15 import org.splat.kernel.MissedPropertyException;
16 import org.splat.kernel.MultiplyDefinedException;
17 import org.splat.som.Step;
18
19 /**
20  * Scenario service interface.
21  * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
22  */
23 public interface ScenarioService {
24
25         /**
26          * Add a new knowledge element to the scenario.
27          * 
28          * @param aScenario
29          *            the scenario
30          * @param kprop
31          *            knowledge element properties
32          * @return the created knowledge element
33          * @throws MissedPropertyException
34          *             if a mandatory property is missed
35          * @throws InvalidPropertyException
36          *             if some property doesn't exist
37          * @throws MultiplyDefinedException
38          *             if some property is defined several times
39          */
40         public KnowledgeElement addKnowledgeElement(Scenario aScenario,
41                         KnowledgeElement.Properties kprop) throws MissedPropertyException,
42                         InvalidPropertyException, MultiplyDefinedException;
43
44         /**
45          * Check in the scenario.
46          * 
47          * @param aScenario
48          *            the scenario to check in
49          */
50         public void checkin(Scenario aScenario);
51
52         /**
53          * Copy contents from other scenario up to its given step into the given scenario.
54          * 
55          * @param scenario
56          *            the target scenario
57          * @param lastep
58          *            the last processed step of the source scenario
59          */
60         public void copyContentsUpTo(Scenario scenario, Step lastep);
61
62         /**
63          * Check if the scenario is empty, i.d. no one of its steps doesn't contain any knowledge elements or documents.
64          * 
65          * @param scenario
66          *            the scenario to check
67          * @return true if the scenario is empty
68          */
69         public boolean isEmpty(Scenario scenario);
70 }