use of org.kie.workbench.common.services.datamodeller.core.ObjectSource in project kie-wb-common by kiegroup.
the class ModuleDataModelOracleUtils method loadExternalDependencies.
public static void loadExternalDependencies(DataModel dataModel, ModuleDataModelOracle moduleDataModelOracle, ClassLoader classLoader) throws ModelDriverException {
String[] factTypes = DataModelOracleUtilities.getFactTypes(moduleDataModelOracle);
ObjectSource source;
if (factTypes != null) {
for (int i = 0; i < factTypes.length; i++) {
source = factSource(moduleDataModelOracle, factTypes[i]);
if (source != null && ObjectSource.DEPENDENCY.equals(source)) {
addType(dataModel, moduleDataModelOracle, factTypes[i], classLoader);
}
}
}
}
use of org.kie.workbench.common.services.datamodeller.core.ObjectSource in project kie-wb-common by kiegroup.
the class DataModelOracleModelDriver method loadModel.
public DataModel loadModel(ModuleDataModelOracle oracleDataModel, ClassLoader moduleClassLoader) throws ModelDriverException {
DataModel dataModel = createModel();
logger.debug("Adding oracleDataModel: " + oracleDataModel + " to dataModel: " + dataModel);
String[] factTypes = DataModelOracleUtilities.getFactTypes(oracleDataModel);
ObjectSource source = null;
if (factTypes != null && factTypes.length > 0) {
for (int i = 0; i < factTypes.length; i++) {
// skip .drl declared fact types.
source = factSource(oracleDataModel, factTypes[i]);
if (source != null && (ObjectSource.INTERNAL.equals(source) || ObjectSource.DEPENDENCY.equals(source))) {
addFactType(dataModel, oracleDataModel, factTypes[i], source, moduleClassLoader);
}
}
} else {
logger.debug("oracleDataModel hasn't defined fact types");
}
return dataModel;
}
Aggregations