1 /*****************************************************************************
5 * Creation date 16.10.2012
8 *****************************************************************************/
10 package org.splat.service;
12 import java.util.List;
14 import org.splat.dal.bo.som.SimulationContext;
15 import org.splat.dal.bo.som.SimulationContextType;
16 import org.splat.kernel.InvalidPropertyException;
17 import org.splat.service.technical.ProjectSettingsService;
20 * Simulation context service interface.
22 * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
25 public interface SimulationContextService {
28 * Get simulation context by its id.
31 * simulation context id.
32 * @return found context
34 public SimulationContext selectSimulationContext(long index);
37 * Find simulation context by its type and value.
43 * @return found context
45 public SimulationContext selectSimulationContext(
46 SimulationContextType celt, String value);
49 * Find simulation contexts by example.
53 * @return list of contexts
55 public List<SimulationContext> selectSimulationContextsWhere(
56 SimulationContext.Properties cprop);
59 * Create a simulation context type.
64 * activity related to this context type
65 * @return the created context type
66 * @throws InvalidPropertyException
67 * if some property of the type to be created is invalid
69 public SimulationContextType createType(String name,
70 ProjectSettingsService.Step step) throws InvalidPropertyException;
73 * Get all simulation context types.
75 * @return list of context types
77 public List<SimulationContextType> selectAllTypes();
80 * Get simulation context types related to given activities.
84 * @return list of found context types
86 public List<SimulationContextType> selectTypesOf(
87 ProjectSettingsService.Step... step);
90 * Get simulation context types by example.
94 * @return list of found context types
96 public List<SimulationContextType> selectTypesWhere(
97 SimulationContextType.Properties sprop);
100 * Get a simulation context type by its name.
103 * name of the context type
104 * @return found context type
106 public SimulationContextType selectType(String name);
109 * Get simulation context type by its id.
112 * simulation context type id.
113 * @return found context type
115 public SimulationContextType selectType(long index);
118 * Hold the simulation context.
121 * the context to hold.
123 public void hold(SimulationContext simCtx);
126 * Release the simulation context.
129 * the context to release
131 public void release(SimulationContext simCtx);
134 * Get the simulation context list for displaying drop-down list values populating on the "Create new study" screen.
136 * @return List of the simulation contexts.
138 List<SimulationContext> getSimulationContextList();
141 * Approve the simulation context type.
144 * the type to approve
145 * @return true if approval succeeded
147 public boolean approve(SimulationContextType simCtxType);
153 public ProjectSettingsService.Step getAttachedStep(
154 SimulationContextType simCtxType);