def get_goal_model(self, environment_name, goal_name, usecase_name, is_top_level): fontName, fontSize, apFontName = get_fonts(session_id=self.session_id) try: associationDictionary = {} goalFilter = 0 ucFilter = 0 if goal_name != '': goalFilter = 1 if usecase_name != '': ucFilter = 1 goal_name = usecase_name associationDictionary = self.db_proxy.goalModel( environment_name, goal_name, is_top_level, ucFilter) associations = KaosModel(list(associationDictionary.values()), environment_name, 'goal', goal_name, db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize) dot_code = associations.graph() return dot_code except DatabaseProxyException as ex: self.close() raise ARMHTTPError(ex)
def get_task_model(self, environment_name,task_name,misusecase_name, pathValues = []): fontName, fontSize, apFontName = get_fonts(session_id=self.session_id) if task_name == 'all': task_name = '' if misusecase_name == 'all': misusecase_name = '' try: mcFilter = False filter_name = task_name if misusecase_name != '': mcFilter = True filter_name = misusecase_name associationDirectory = self.db_proxy.taskModel(environment_name,filter_name,mcFilter) associations = KaosModel(list(associationDirectory.values()), environment_name, kaosModelType = 'task',goalName = filter_name,db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize) dot_code = associations.graph() if not dot_code: raise ObjectNotFoundHTTPError('The task model') return dot_code except DatabaseProxyException as ex: self.close() raise ARMHTTPError(ex) except ARMException as ex: self.close() raise ARMHTTPError(ex)
def get_task_model(self, environment_name, task_name, misusecase_name): fontName, fontSize, apFontName = get_fonts(session_id=self.session_id) try: mcFilter = False filter_name = task_name if misusecase_name != "": mcFilter = True filter_name = misusecase_name associationDirectory = self.db_proxy.taskModel(environment_name, filter_name, mcFilter) associations = KaosModel( associationDirectory.values(), environment_name, kaosModelType="task", goalName=filter_name, db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize, ) dot_code = associations.graph() if not dot_code: raise ObjectNotFoundHTTPError("The task model") return dot_code except DatabaseProxyException as ex: self.close() raise ARMHTTPError(ex) except ARMException as ex: self.close() raise ARMHTTPError(ex)
def get_responsibility_model(self, environment_name, role_name): fontName, fontSize, apFontName = get_fonts(session_id=self.session_id) try: associationDictionary = self.db_proxy.responsibilityModel(environment_name, role_name) associations = KaosModel(associationDictionary.values(), environment_name, 'responsibility',goalName=role_name,db_proxy=self.db_proxy, font_name=fontName,font_size=fontSize) dot_code = associations.graph() return dot_code except DatabaseProxyException as ex: self.close() raise ARMHTTPError(ex)
def get_obstacle_model(self, environment_name, obstacle_name): fontName, fontSize, apFontName = get_fonts(session_id=self.session_id) try: obstacle_filter = 0 associationDictionary = self.db_proxy.obstacleModel(environment_name, obstacle_name, obstacle_filter) associations = KaosModel(list(associationDictionary.values()), environment_name, 'obstacle',obstacle_name,db_proxy=self.db_proxy, font_name=fontName,font_size=fontSize) dot_code = associations.graph() return dot_code except DatabaseProxyException as ex: self.close() raise ARMHTTPError(ex)
def get_obstacle_model(self, environment_name, obstacle_name): fontName, fontSize, apFontName = get_fonts(session_id=self.session_id) try: obstacle_filter = 0 if obstacle_name != '': obstacle_filter = 1 associationDictionary = self.db_proxy.obstacleModel(environment_name, obstacle_name, obstacle_filter) associations = KaosModel(associationDictionary.values(), environment_name, 'obstacle',obstacle_name,db_proxy=self.db_proxy, font_name=fontName,font_size=fontSize) dot_code = associations.graph() return dot_code except DatabaseProxyException as ex: self.close() raise ARMHTTPError(ex)
def get_goal_model(self, environment_name,goal_name,usecase_name): fontName, fontSize, apFontName = get_fonts(session_id=self.session_id) try: associationDictionary = {} goalFilter = 0 ucFilter = 0 if goal_name != '': goalFilter = 1 if usecase_name != '': ucFilter = 1 associationDictionary = self.db_proxy.goalModel(environment_name,goal_name,goalFilter,ucFilter) associations = KaosModel(associationDictionary.values(), environment_name, 'goal',goal_name,db_proxy=self.db_proxy, font_name=fontName,font_size=fontSize) dot_code = associations.graph() return dot_code except DatabaseProxyException as ex: self.close() raise ARMHTTPError(ex)
def get_component_goal_model(self,cName): fontName, fontSize, apFontName = get_fonts(session_id=self.session_id) try: associationDictionary = self.db_proxy.componentGoalModel(cName) associations = KaosModel(associationDictionary.values(), '',kaosModelType='template_goal',db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize) dot_code = associations.graph() return dot_code except DatabaseProxyException as ex: self.close() raise ARMHTTPError(ex) except ARMException as ex: self.close() raise ARMHTTPError(ex) except Exception as ex: print(ex)
def get_task_model(self, environment_name): fontName, fontSize, apFontName = get_fonts(session_id=self.session_id) try: associationDirectory = self.db_proxy.taskModel(environment_name) associations = KaosModel(associationDirectory.values(), environment_name, kaosModelType = 'task',db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize) dot_code = associations.graph() if not dot_code: raise ObjectNotFoundHTTPError('The task model') return dot_code except DatabaseProxyException as ex: self.close() raise ARMHTTPError(ex) except ARMException as ex: self.close() raise ARMHTTPError(ex)