// @Override protected void updateDependencies(ModelElement element) { // update client dependency // if IndicatorDefinition have client depencency, add codes here IndicatorDefinition definition = (IndicatorDefinition) element; Property property = PropertyHelper.getProperty(definition); List<IRepositoryViewObject> listIndicatorDependency = DependenciesHandler.getInstance() .getIndicatorDependency(new RepositoryViewObject(property)); for (IRepositoryViewObject viewObject : listIndicatorDependency) { Item item = viewObject.getProperty().getItem(); if (item instanceof TDQAnalysisItem) { try { ProxyRepositoryFactory.getInstance().save(item); } catch (PersistenceException e) { log.error(e, e); } } } }
public boolean addIndicator(NamedColumnSet set, Indicator... indicators) { if (!analysis.getContext().getAnalysedElements().contains(set)) { analysis.getContext().getAnalysedElements().add(set); } for (Indicator indicator : indicators) { // store first level of indicators in result. analysis.getResults().getIndicators().add(indicator); initializeIndicator(indicator, set); } DataManager connection = analysis.getContext().getConnection(); if (connection == null) { // try to get one log.error( Messages.getString( "ColumnCorrelationAnalysisHandler.CONNNOTBEENSETINANALYSIS")); //$NON-NLS-1$ connection = ConnectionHelper.getTdDataProvider(PackageHelper.getParentPackage((MetadataTable) set)); analysis.getContext().setConnection(connection); } TypedReturnCode<Dependency> rc = DependenciesHandler.getInstance().setDependencyOn(analysis, connection); return rc.isOk(); }