1 /*****************************************************************************
5 * Creation date 06.10.2012
8 *****************************************************************************/
10 package org.splat.service;
12 import org.splat.dal.bo.kernel.User;
13 import org.splat.dal.bo.som.KnowledgeElement;
14 import org.splat.dal.bo.som.Scenario;
15 import org.splat.dal.bo.som.Study;
16 import org.splat.kernel.InvalidPropertyException;
17 import org.splat.kernel.MissedPropertyException;
18 import org.splat.kernel.MultiplyDefinedException;
19 import org.splat.som.Step;
22 * Scenario service interface.
24 * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
26 public interface ScenarioService {
29 * Add a new scenario to the study.
35 * @return the added scenario
36 * @throws MissedPropertyException
37 * if a mandatory property is missed
38 * @throws InvalidPropertyException
39 * if some property doesn't exist
40 * @throws MultiplyDefinedException
41 * if some property occurs several times
43 public Scenario addScenario(Study aStudy, Scenario.Properties sprop)
44 throws MissedPropertyException, InvalidPropertyException,
45 MultiplyDefinedException;
48 * Add a new knowledge element to the scenario.
53 * knowledge element properties
54 * @return the created knowledge element
55 * @throws MissedPropertyException
56 * if a mandatory property is missed
57 * @throws InvalidPropertyException
58 * if some property doesn't exist
59 * @throws MultiplyDefinedException
60 * if some property is defined several times
62 public KnowledgeElement addKnowledgeElement(Scenario aScenario,
63 KnowledgeElement.Properties kprop) throws MissedPropertyException,
64 InvalidPropertyException, MultiplyDefinedException;
67 * Check in the scenario.
70 * the scenario to check in
72 public void checkin(Scenario aScenario);
75 * Check out the scenario.
78 * the scenario to check out
81 * @return true if check out operation succeeded
83 public boolean checkout(Scenario aScenario, User user);
86 * Copy contents from other scenario up to its given step into the given scenario.
91 * the last processed step of the source scenario
93 public void copyContentsUpTo(Scenario scenario, Step lastep);
96 * Check if the scenario is empty, i.d. no one of its steps doesn't contain any knowledge elements or documents.
99 * the scenario to check
100 * @return true if the scenario is empty
102 public boolean isEmpty(Scenario scenario);