use of org.drools.workbench.services.verifier.api.client.index.Field in project drools-wb by kiegroup.
the class RuleInspectorCache method deleteColumns.
public void deleteColumns(final int firstColumnIndex) {
final Collection<Column> all = index.getColumns().where(Column.index().is(firstColumnIndex)).select().all();
final Fields.FieldSelector fieldSelector = index.getRules().where(UUIDMatcher.uuid().any()).select().patterns().where(UUIDMatcher.uuid().any()).select().fields().where(UUIDMatcher.uuid().any()).select();
final ArrayList<Action> actions = new ArrayList<>();
final ArrayList<Condition> conditions = new ArrayList<>();
for (final Field field : fieldSelector.all()) {
for (final Column column : all) {
final Collection<Action> all1 = field.getActions().where(Action.columnUUID().is(column.getUuidKey())).select().all();
final Collection<Condition> all2 = field.getConditions().where(Condition.columnUUID().is(column.getUuidKey())).select().all();
actions.addAll(all1);
conditions.addAll(all2);
}
}
for (final Action action : actions) {
action.getUuidKey().retract();
}
for (final Condition condition : conditions) {
condition.getUuidKey().retract();
}
for (final Column column : all) {
column.getUuidKey().retract();
}
reset();
}
use of org.drools.workbench.services.verifier.api.client.index.Field in project drools-wb by kiegroup.
the class FieldInspectorRelationsTest method testSubsumpt02.
@Test
public void testSubsumpt02() throws Exception {
final FieldInspector x = new FieldInspector(new Field(mock(ObjectField.class), "org.Address", "String", "name", configurationMock), mock(RuleInspectorUpdater.class), mock(AnalyzerConfiguration.class));
assertFalse(x.subsumes(b));
assertFalse(b.subsumes(x));
}
use of org.drools.workbench.services.verifier.api.client.index.Field in project drools-wb by kiegroup.
the class ActionBuilder method addAction.
private Action addAction(final ActionCol52 actionCol, final DTCellValue52 visibleCellValue) throws BuildException {
final Field field = resolveField(actionCol);
final Action action = buildAction(field, visibleCellValue);
field.getActions().add(action);
return action;
}
use of org.drools.workbench.services.verifier.api.client.index.Field in project drools-wb by kiegroup.
the class ConditionsInspectorTest method testSubsume003.
@Test
public void testSubsume003() throws Exception {
final Field nameField = new Field(new ObjectField("Person", "String", "name", configurationMock), "Person", "String", "name", configurationMock);
final Field lastNameField = new Field(new ObjectField("Person", "String", "lastName", configurationMock), "Person", "String", "lastName", configurationMock);
final ConditionsInspectorMultiMap a = getConditions(new ComparableConditionInspector<String>(new FieldCondition(nameField, mock(Column.class), "==", new Values<>("Toni"), configurationMock), configurationMock));
final ConditionsInspectorMultiMap b = getConditions(new ComparableConditionInspector<Integer>(new FieldCondition(field, mock(Column.class), "==", new Values<>(12), configurationMock), configurationMock), new ComparableConditionInspector<String>(new FieldCondition(nameField, mock(Column.class), "==", new Values<>("Toni"), configurationMock), configurationMock), new ComparableConditionInspector<String>(new FieldCondition(lastNameField, mock(Column.class), "==", new Values<>("Rikkola"), configurationMock), configurationMock));
assertFalse(a.subsumes(b));
assertTrue(b.subsumes(a));
}
use of org.drools.workbench.services.verifier.api.client.index.Field in project drools-wb by kiegroup.
the class ConditionsInspectorTest method testSubsume002.
@Test
public void testSubsume002() throws Exception {
final ConditionsInspectorMultiMap a = getConditions(new ComparableConditionInspector<Integer>(new FieldCondition(field, mock(Column.class), "==", new Values<>(1), configurationMock), configurationMock));
final ConditionsInspectorMultiMap b = getConditions(new ComparableConditionInspector<Integer>(new FieldCondition(field, mock(Column.class), "==", new Values<>(1), configurationMock), configurationMock), new ComparableConditionInspector<Integer>(new FieldCondition(new Field(mock(ObjectField.class), "Person", "Integer", "balance", configurationMock), mock(Column.class), "==", new Values<>(111111111), configurationMock), configurationMock));
assertFalse(a.subsumes(b));
assertTrue(b.subsumes(a));
}
Aggregations