use of org.drools.verifier.core.index.model.FieldCondition in project drools by kiegroup.
the class ConditionsListenerTest method testListen.
@Test
public void testListen() throws Exception {
conditions.add(new FieldCondition(new Field(mock(ObjectField.class), "Person", "String", "name", configuration), new Column(1, configuration), "==", new Values<>(10), configuration));
verify(allListener).onAllChanged(anyCollection());
}
use of org.drools.verifier.core.index.model.FieldCondition in project drools-wb by kiegroup.
the class RegularCellUpdateManager method updateCondition.
@Override
protected boolean updateCondition(final Condition condition) {
final Values oldValues = condition.getValues();
Values values = null;
final DTCellValue52 cell = model.getData().get(coordinate.getRow()).get(coordinate.getCol());
final BaseColumn baseColumn = model.getExpandedColumns().get(coordinate.getCol());
if (baseColumn instanceof ConditionCol52 && condition instanceof FieldCondition) {
final DTCellValue52 realCellValue = getRealCellValue((ConditionCol52) baseColumn, cell);
final Optional<String> operatorFromCell = Utils.findOperatorFromCell(realCellValue);
if (operatorFromCell.isPresent()) {
((FieldCondition) condition).setOperator(operatorFromCell.get());
}
values = useResolver(configuration, (FieldCondition) condition, realCellValue, (ConditionCol52) baseColumn);
} else {
values = getValue(cell);
}
if (values == null && oldValues == null) {
return false;
} else if (values == null || oldValues == null) {
condition.setValue(values);
return true;
} else if (values.isThereChanges(oldValues)) {
condition.setValue(values);
return true;
} else {
return false;
}
}
Aggregations