Change all data types in logical models from domain to logical
Data Modeler transformation script to change all data types in logical models from domain to logical.
This can be run from the Transformation Dialog.
function getDateAsString()
{
var d = new Date();
return d.getFullYear() + "-" + (d.getMonth()+1) + "-" + d.getDate();
}
function prependNotes(item, prependString)
{
currentNote = item.getNotes();
var versionNotes = "[" + getDateAsString() + ":" + prependString + "]\n";
item.setNotes(versionNotes + currentNote);
}
function processEntity(entity)
{
attributes = entity.getAttributes();
for(var b=0; b < attributes.length; b++)
{
processAttributes(entity, attributes[b]);
}
}
function processAttributes(entity, attribute)
{
name = attribute.getName();
if(attribute.getDataTypeKind() != "LT")
{
attribute.setLogicalDatatype(attribute.getLogicalDatatype());
attribute.setDomain(null);
attribute.setDirty(true);
prependNotes(attribute, "DataType Kind changed from Domain to Logical");
}
}
entities = model.getEntitySet().toArray();
//entities = model.getSubViewByName("subviewname").getEntities();
for(var a=0; a < entities.length; a++)
{
processEntity(entities[a]);
}
Last modified on 2016-03-20