if(!"".equals(newId) && null!=newId){
DomainObject domObj = DomainObject.newInstance(context,projectId);
MapList exitModelList = domObj.getRelatedObjects(context,"STN Related Model","Model", new StringList("id"), new StringList("id[connection]"),false,true,(short)1, null, null);
Map<String,String> exitModelIdList=new HashMap<String,String>();
if(exitModelList.size()>0)
{
Iterator it = exitModelList.iterator();
while(it.hasNext()){
Map map = (Map)it.next();
String id=(String)map.get("id");
//exitModelIdList.put("id",id);
//if(!newIds.contains(id)){
String rid=(String)map.get("id[connection]");
DomainRelationship.disconnect(context,rid);
//}
}
}
for(int i = 0;i<newIds.length;i++){
//domObj.setAttributeValue(context, "STN Machine Model", newIds[i]);
RelationshipType relType = new RelationshipType("STN Related Model");
//if(!exitModelIdList.containsValue(newIds[i]))
domObj.addToObject(context, relType, newIds[i]);
}
}