final FactModels factModels = FactModelPersistence.unmarshal( declaredType );
final String packageName = factModels.getPackageName();
final DataModelTO dataModelTO = new DataModelTO();
for ( FactMetaModel factMetaModel : factModels.getModels() ) {
final DataObjectTO dataObjectTO = new DataObjectTO( factMetaModel.getName(),
packageName,
factMetaModel.getSuperType() );
final List<AnnotationMetaModel> annotationMetaModel = factMetaModel.getAnnotations();
addAnnotations( dataObjectTO,
annotationMetaModel );
final List<FieldMetaModel> fields = factMetaModel.getFields();
for ( FieldMetaModel fieldMetaModel : fields ) {
final String fieldName = fieldMetaModel.name;
final String fieldType = fieldMetaModel.type;
//Guvnor 5.5 (and earlier) does not have MultipleType
boolean isMultiple = false;
boolean isBaseType = orderedBaseTypes.containsValue( fieldType );
ObjectPropertyTO property = new ObjectPropertyTO( fieldName,
fieldType,
isMultiple,
isBaseType );
//field has no annotation in Guvnor 5.5 (and earlier)
dataObjectTO.getProperties().add( property );
result.addMessage( "Created Java Type " + getJavaTypeFQCN( dataObjectTO ),
ConversionMessageType.INFO );
}