use of org.drools.workbench.services.verifier.api.client.index.Fields 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();
}
Aggregations