Hi all,
I need to know if there exist models in our database which
- have versions
- and whose "state" attribute (AT_STATE) has never had the value "released" (AVT_RELEASED) in any version
My thinking was :
- loop through all models
- for every model , check if the model has versions (using : Context.getComponent("Versioning").getModelRevisions(model)
- for every version , look at the model state attribute value
I'm stuck at point "2" because getRevisions() returns RevisionInfo objects which give two kinds of information
- a revision number
- a ChangelistInfo object , which itself only gives : the time at which the revision has been made, by whom, etc
I'm still at a loss to know how to retrieve the attribute values for the different model revisions
Any ideas ?
Thanks
MB
A few lines of code to illustrate one way to do it
var serverComponent = Context.getComponent("Versioning"); var versions = serverComponent.getModelRevisions(model); // model is a Model Object var changelistId = versions[0].getChangeListInfo().getID(); // let's look at the model first revision var currentDB = ArisData.getActiveDatabase(); var db = ArisData.openDatabaseVersion(currentDB.Name(0), changelistId); var oldModel = db.FindGUID(model.GUID()); if (oldModel && oldModel.IsValid()) { var modelState = oldModel.Attribute(Constants.AT_STATE_1,locale).MeasureUnitTypeNum(); // do some work } db.close();