use of org.drools.model.Declaration in project drools by kiegroup.
the class ViewFlowBuilder method addInputFromVariableSource.
private static void addInputFromVariableSource(Map<Variable<?>, InputViewItemImpl<?>> inputs, Variable<?> patterVariable) {
if (patterVariable instanceof Declaration) {
Declaration declaration = ((Declaration) patterVariable);
if (declaration.getSource() instanceof From) {
Variable var = ((From) declaration.getSource()).getVariable();
addInputFromVariableSource(inputs, var);
if (var.isFact()) {
inputs.putIfAbsent(var, (InputViewItemImpl) input(var));
}
}
}
}
use of org.drools.model.Declaration 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;
}
Aggregations