1 /*****************************************************************************
5 * Creation date 06.10.2012
8 *****************************************************************************/
10 package org.splat.service;
12 import java.util.List;
14 import org.splat.dal.bo.kernel.User;
15 import org.splat.dal.bo.som.KnowledgeElement;
16 import org.splat.dal.bo.som.Scenario;
17 import org.splat.dal.bo.som.SimulationContext;
18 import org.splat.dal.bo.som.Study;
19 import org.splat.kernel.InvalidPropertyException;
20 import org.splat.kernel.MissedPropertyException;
21 import org.splat.kernel.MultiplyDefinedException;
22 import org.splat.service.dto.StepDTO;
23 import org.splat.som.Step;
26 * Scenario service interface.
28 * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
30 public interface ScenarioService {
33 * Get lists of scenario steps, documents and files for building siman-salome.conf file.
37 * @return list of step DTOs
39 List<StepDTO> getScenarioInfo(long scenarioId);
42 * Create a new study with one scenario and "product" simulation context.
45 * the study properties
47 * the scenario properties
49 * the "product" simulation context properties
50 * @return the created study
51 * @throws MissedPropertyException
52 * if a mandatory property is missed
53 * @throws InvalidPropertyException
54 * if a property is invalid
55 * @throws MultiplyDefinedException
56 * if some property occurs several times
58 Study createStudy(Study.Properties sprop, Scenario.Properties oprop,
59 SimulationContext.Properties cprop) throws MissedPropertyException,
60 InvalidPropertyException, MultiplyDefinedException;
63 * Add a new scenario to the study.
69 * @return the added scenario
70 * @throws MissedPropertyException
71 * if a mandatory property is missed
72 * @throws InvalidPropertyException
73 * if some property doesn't exist
74 * @throws MultiplyDefinedException
75 * if some property occurs several times
77 Scenario addScenario(Study aStudy, Scenario.Properties sprop)
78 throws MissedPropertyException, InvalidPropertyException,
79 MultiplyDefinedException;
82 * Add a new knowledge element to the scenario.
87 * knowledge element properties
88 * @return the created knowledge element
89 * @throws MissedPropertyException
90 * if a mandatory property is missed
91 * @throws InvalidPropertyException
92 * if some property doesn't exist
93 * @throws MultiplyDefinedException
94 * if some property is defined several times
96 KnowledgeElement addKnowledgeElement(Scenario aScenario,
97 KnowledgeElement.Properties kprop) throws MissedPropertyException,
98 InvalidPropertyException, MultiplyDefinedException;
101 * Check in the scenario.
104 * the scenario to check in
106 void checkin(Scenario aScenario);
109 * Check out the scenario.
112 * the scenario to check out
115 * @return true if check out operation succeeded
117 boolean checkout(Scenario aScenario, User user);
120 * Copy contents from other scenario up to its given step into the given scenario.
123 * the target scenario
125 * the last processed step of the source scenario
127 void copyContentsUpTo(Scenario scenario, Step lastep);
130 * Check if the scenario is empty, i.d. no one of its steps doesn't contain any knowledge elements or documents.
133 * the scenario to check
134 * @return true if the scenario is empty
136 boolean isEmpty(Scenario scenario);
139 * Remove a knowledge element from a scenario.
144 * the knowledge element to remove
145 * @return true if removal succeeded
147 boolean removeKnowledgeElement(Scenario scenario, KnowledgeElement kelm);