* Assign the new simulation context to the existing study.
* @param studyId - the target study id.
* @param contextName - new context name.
+ * @param contextType - new context type.
* @return success or not.
*/
- String assignSimulationContext(final Long studyId, final String contextName);
+ String assignSimulationContext(final Long studyId, final String contextType, final String contextName);
}
* {@inheritDoc}
* @see org.splat.ws_server.service.salome.SimanSalomeService#assignSimulationContext(java.lang.Long, java.lang.String)
*/
- public String assignSimulationContext(final Long studyId, final String contextName) {
+ public String assignSimulationContext(final Long studyId, final String contextType, final String contextName) {
- return "result";
+ try {
+ _scenarioService.assignStudyContext(studyId, contextType, contextName);
+ } catch (MissedPropertyException e) {
+ LOG.debug("MissedPropertyException is thrown");
+ } catch (InvalidPropertyException e) {
+ return "Study id is invalid";
+ } catch (MultiplyDefinedException e) {
+ LOG.debug("MultiplyDefinedException is thrown");
+ }
+
+ return "Simulation context is successfully assigned to the study.";
}
/**
* Get the scenarioService.