private void updateMocaTreeFragments() { // For all packages (recursively!) in TGG and Ecore projects foreach (EA.Package p in EAUtil.findAllMoflonPackages(repository)) { SQLPackage p2 = sqlRep.GetPackageByID(p.PackageID); if (p.Element.Stereotype == TGGModelingMain.TggSchemaPackageStereotype) { TGG tgg = new TGG(sqlRep, p2); tgg.loadTreeFromTaggedValue(); tgg.saveTreeToEATaggedValue(false); } else if (p.Element.Stereotype == TGGModelingMain.TggRulePackageStereotype) { TGGRulePackage package = new TGGRulePackage(p2, sqlRep); package.loadTreeFromTaggedValue(); package.saveTreeToEATaggedValue(false); } else { EPackage package = new EPackage(p2, sqlRep); package.loadTreeFromTaggedValue(); package.saveTreeToEATaggedValue(false); } } foreach (EA.Element eClassElement in EAUtil.findAllEClasses(repository)) { EClass eClass = new EClass(sqlRep.GetElementByID(eClassElement.ElementID), sqlRep); eClass.saveTreeToEATaggedValue(false); } foreach (EA.Element ruleElement in EAUtil.findAllStereotypedElements(repository, TGGModelingMain.TggRuleStereotype)) { TGGRule rule = new TGGRule(sqlRep, sqlRep.GetElementByID(ruleElement.ElementID)); rule.loadTreeFromTaggedValue(); rule.saveTreeToEATaggedValue(false); } foreach (EA.Element corrTypeElement in EAUtil.findAllStereotypedElements(repository, TGGModelingMain.TggCorrespondenceTypeStereotype)) { TGGCorrespondenceType corrType = new TGGCorrespondenceType(sqlRep.GetElementByID(corrTypeElement.ElementID), sqlRep); corrType.loadTreeFromTaggedValue(); corrType.saveTreeToEATaggedValue(false); } }
private void updateToStandardTaggedValues() { // For all packages (recursively!) in TGG and Ecore projects // Create new set of tagged values if not already present and set to default value foreach (EA.Package p in EAUtil.findAllMoflonPackages(repository)) { SQLPackage p2 = sqlRep.GetPackageByID(p.PackageID); EPackage package = new EPackage(p2, sqlRep); package.updateToStandardTaggedValues(); } /* deleteOldOvTaggedValues(SDMModelingMain.ObjectVariableStereotype); * deleteOldOvTaggedValues(TGGModelingMain.TggObjectVariableStereotype); * deleteOldOvTaggedValues(TGGModelingMain.TggCorrespondenceStereotype); * * deleteOlvLvTaggedValues(SDMModelingMain.LinkVariableStereotype); * deleteOlvLvTaggedValues(TGGModelingMain.TggLinkVariableStereotype); */ }