use of org.camunda.bpm.model.xml.ModelException in project camunda-xml-model by camunda.
the class AttributeReferenceCollectionBuilderImpl method performModelBuild.
@SuppressWarnings("unchecked")
public void performModelBuild(Model model) {
// register declaring type as a referencing type of referenced type
ModelElementTypeImpl referenceTargetType = (ModelElementTypeImpl) model.getType(referenceTargetElement);
// the actual referenced type
attributeReferenceCollection.setReferenceTargetElementType(referenceTargetType);
// the referenced attribute may be declared on a base type of the referenced type.
AttributeImpl<String> idAttribute = (AttributeImpl<String>) referenceTargetType.getAttribute("id");
if (idAttribute != null) {
idAttribute.registerIncoming(attributeReferenceCollection);
attributeReferenceCollection.setReferenceTargetAttribute(idAttribute);
} else {
throw new ModelException("Element type " + referenceTargetType.getTypeNamespace() + ":" + referenceTargetType.getTypeName() + " has no id attribute");
}
}
Aggregations