public DataField createXPDLObject(DataFields dfs, String type, boolean addToCollection) {
DataField df = (DataField) dfs.generateNewElement();
adjustType(df, type);
JaWETypes jts = JaWEManager.getInstance().getJaWEController().getJaWETypes();
boolean hasTemplate = jts.hasTemplateId(type);
if (hasTemplate) {
jts.fillFromTemplate(df, type);
}
String id = df.getId();
if (!hasTemplate || id.equals("") || dfs.getDataField(id) != null) {
if (id.equals("")) {
id = JaWEManager.getInstance().getIdFactory().generateUniqueId(dfs);