Search in sources :

Example 1 with ObjectSource

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);
            }
        }
    }
}
Also used : ObjectSource(org.kie.workbench.common.services.datamodeller.core.ObjectSource)

Example 2 with ObjectSource

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;
}
Also used : DataModel(org.kie.workbench.common.services.datamodeller.core.DataModel) ObjectSource(org.kie.workbench.common.services.datamodeller.core.ObjectSource)

Aggregations

ObjectSource (org.kie.workbench.common.services.datamodeller.core.ObjectSource)2 DataModel (org.kie.workbench.common.services.datamodeller.core.DataModel)1