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.SimulationContext;
16 import org.splat.dal.bo.som.Study;
17 import org.splat.kernel.InvalidPropertyException;
18 import org.splat.kernel.MissedPropertyException;
19 import org.splat.kernel.MultiplyDefinedException;
20 import org.splat.som.Step;
23 * Scenario service interface.
25 * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
27 public interface ScenarioService {
30 * Create a new study with one scenario and "product" simulation context.
33 * the study properties
35 * the scenario properties
37 * the "product" simulation context properties
38 * @return the created study
39 * @throws MissedPropertyException
40 * if a mandatory property is missed
41 * @throws InvalidPropertyException
42 * if a property is invalid
43 * @throws MultiplyDefinedException
44 * if some property occurs several times
46 Study createStudy(Study.Properties sprop, Scenario.Properties oprop,
47 SimulationContext.Properties cprop) throws MissedPropertyException,
48 InvalidPropertyException, MultiplyDefinedException;
51 * Add a new scenario to the study.
57 * @return the added scenario
58 * @throws MissedPropertyException
59 * if a mandatory property is missed
60 * @throws InvalidPropertyException
61 * if some property doesn't exist
62 * @throws MultiplyDefinedException
63 * if some property occurs several times
65 Scenario addScenario(Study aStudy, Scenario.Properties sprop)
66 throws MissedPropertyException, InvalidPropertyException,
67 MultiplyDefinedException;
70 * Add a new knowledge element to the scenario.
75 * knowledge element properties
76 * @return the created knowledge element
77 * @throws MissedPropertyException
78 * if a mandatory property is missed
79 * @throws InvalidPropertyException
80 * if some property doesn't exist
81 * @throws MultiplyDefinedException
82 * if some property is defined several times
84 KnowledgeElement addKnowledgeElement(Scenario aScenario,
85 KnowledgeElement.Properties kprop) throws MissedPropertyException,
86 InvalidPropertyException, MultiplyDefinedException;
89 * Check in the scenario.
92 * the scenario to check in
94 void checkin(Scenario aScenario);
97 * Check out the scenario.
100 * the scenario to check out
103 * @return true if check out operation succeeded
105 boolean checkout(Scenario aScenario, User user);
108 * Copy contents from other scenario up to its given step into the given scenario.
111 * the target scenario
113 * the last processed step of the source scenario
115 void copyContentsUpTo(Scenario scenario, Step lastep);
118 * Check if the scenario is empty, i.d. no one of its steps doesn't contain any knowledge elements or documents.
121 * the scenario to check
122 * @return true if the scenario is empty
124 boolean isEmpty(Scenario scenario);
127 * Remove a knowledge element from a scenario.
132 * the knowledge element to remove
133 * @return true if removal succeeded
135 boolean removeKnowledgeElement(Scenario scenario,
136 KnowledgeElement kelm);