If you ever needed to change the logical data types via a transformation script, you’ll need to get the type by name. The lines below will get the logical type and place it in a variable for reuse.

var kBinaryType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName("Binary");
var kBooleanType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName("Boolean");
var kCharType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName("Char");
var kCurrencyType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName("Currency");
var kDateType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName("Date");
var kDateTimeType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName("DateTime");
var kDecimalType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName("Decimal");
var kIntegerType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName("Integer");
var kStringType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName("String");
var kTimeType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName("Time");
var kTimestampType = model.getDesign().getLogicalDatatypeSet().getLogTypeByName("Timestamp");

for example :

attribute.setLogicalDatatype(kTimestampType);