blob: 59acb69429ce4303918e890595a03eed73a9e2d6 [file] [log] [blame]
import org.eclipse.emf.edapt.spi.migration.Instance;
import org.eclipse.emf.edapt.spi.migration.Metamodel;
import org.eclipse.emf.edapt.spi.migration.Model;
public class CountDanglingEdges extends HelloWorldCustomMigration {
@Override
public void migrateBefore(Model model, Metamodel metamodel) {
int dangling = 0;
for (Instance edge : model.getAllInstances("graph1.Edge")) {
if (edge.get("src") == null || edge.get("trg") == null) {
dangling++;
}
}
saveResult(model, dangling);
}
}