Search in sources :

Example 1 with DataSourceDefinition

use of org.drools.model.DataSourceDefinition in project drools by kiegroup.

the class BruteForceEngine method getPatternDataStore.

private DataStore getPatternDataStore(Pattern pattern) {
    DeclarationSource source = ((Declaration) pattern.getPatternVariable()).getSource();
    String sourceName = ((DataSourceDefinition) source).getName();
    DataStore dataStore = (DataStore) dataSources.get(sourceName);
    if (dataStore == null) {
        throw new RuntimeException("Unknonw DataSource: " + sourceName);
    }
    return dataStore;
}
Also used : DataStore(org.drools.model.datasources.DataStore) DeclarationSource(org.drools.model.DeclarationSource) DataSourceDefinition(org.drools.model.DataSourceDefinition) Declaration(org.drools.model.Declaration)

Aggregations

DataSourceDefinition (org.drools.model.DataSourceDefinition)1 Declaration (org.drools.model.Declaration)1 DeclarationSource (org.drools.model.DeclarationSource)1 DataStore (org.drools.model.datasources.DataStore)1