use of org.drools.verifier.core.index.model.Pattern in project drools by kiegroup.
the class RuleInspector method makePatternsInspectors.
private void makePatternsInspectors() {
for (final Pattern pattern : rule.getPatterns().where(Pattern.uuid().any()).select().all()) {
final PatternInspector patternInspector = new PatternInspector(pattern, new RuleInspectorUpdater() {
@Override
public void resetActionsInspectors() {
actionsInspectors = null;
}
@Override
public void resetConditionsInspectors() {
conditionsInspectors = null;
}
}, configuration);
patternInspectorList.add(patternInspector);
}
}
use of org.drools.verifier.core.index.model.Pattern in project drools by kiegroup.
the class PatternInspectorTest method testSubsumpt02.
@Test
public void testSubsumpt02() throws Exception {
final PatternInspector x = new PatternInspector(new Pattern("x", new ObjectType("org.Address", configurationMock), configurationMock), mock(RuleInspectorUpdater.class), mock(AnalyzerConfiguration.class));
assertFalse(x.subsumes(b));
assertFalse(b.subsumes(x));
}
use of org.drools.verifier.core.index.model.Pattern in project drools by kiegroup.
the class PatternInspectorTest method testRedundancy02.
@Test
public void testRedundancy02() throws Exception {
final PatternInspector x = new PatternInspector(new Pattern("x", new ObjectType("org.Address", configurationMock), configurationMock), mock(RuleInspectorUpdater.class), mock(AnalyzerConfiguration.class));
assertFalse(x.isRedundant(b));
assertFalse(b.isRedundant(x));
}
use of org.drools.verifier.core.index.model.Pattern in project drools by kiegroup.
the class PatternInspectorTest method setUp.
@Before
public void setUp() throws Exception {
configurationMock = new AnalyzerConfigurationMock();
a = new PatternInspector(new Pattern("a", new ObjectType("org.Person", configurationMock), configurationMock), mock(RuleInspectorUpdater.class), mock(AnalyzerConfiguration.class));
b = new PatternInspector(new Pattern("b", new ObjectType("org.Person", configurationMock), configurationMock), mock(RuleInspectorUpdater.class), mock(AnalyzerConfiguration.class));
}
use of org.drools.verifier.core.index.model.Pattern in project drools-wb by kiegroup.
the class ConditionBuilder method build.
public Condition build() throws BuildException {
PortablePreconditions.checkNotNull("conditionCol52", conditionCol52);
PortablePreconditions.checkNotNull("columnIndex", columnIndex);
PortablePreconditions.checkNotNull("row", row);
if (conditionCol52 instanceof BRLConditionVariableColumn) {
return builderFactory.getBRLConditionBuilder().with((BRLConditionVariableColumn) conditionCol52).with(row.get(columnIndex)).with(columnIndex).build();
} else {
PortablePreconditions.checkNotNull("rule", rule);
final Pattern pattern = builderFactory.getPatternResolver().with(rule).with(columnIndex).resolve();
return builderFactory.getFieldConditionsBuilder().with(pattern).with(conditionCol52).with(getRealCellValue(conditionCol52, row.get(columnIndex))).with(columnIndex).build();
}
}
Aggregations