To create a new asset type attribute constraint, use RAMAssetType.createAttributeConstraint(RAMAssetAttribute, boolean isRequired). Only a repository administrator can modify global asset types.
//Create Attribute Constraints
RAMAttributeConstraint constraint = assetType.
createAttributeConstraint(session.getAssetAttribute("Custom1"), true);