use of org.drools.workbench.services.verifier.api.client.index.Column 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.Column in project drools-wb by kiegroup.
the class DTableUpdateManager method newColumn.
public void newColumn(final GuidedDecisionTable52 model, final HeaderMetaData headerMetaData, final FactTypes factTypes, final int columnIndex) throws BuildException {
PortablePreconditions.checkNotNull("model", model);
PortablePreconditions.checkNotNull("headerMetaData", headerMetaData);
PortablePreconditions.checkNotNull("fieldTypes", factTypes);
PortablePreconditions.checkNotNull("columnIndex", columnIndex);
final BuilderFactory builderFactory = new BuilderFactory(new VerifierColumnUtilities(model, headerMetaData, factTypes), index, model, headerMetaData, configuration);
final Column column = builderFactory.getColumnBuilder().with(columnIndex).build();
analyzer.newColumn(column);
int rowIndex = 0;
for (final List<DTCellValue52> row : model.getData()) {
final BaseColumn baseColumn = model.getExpandedColumns().get(columnIndex);
final Rule rule = index.getRules().where(Rule.index().is(rowIndex)).select().first();
builderFactory.getCellBuilder().with(columnIndex).with(baseColumn).with(rule).with(row).build();
rowIndex++;
}
analyzer.resetChecks();
analyzer.analyze();
}
use of org.drools.workbench.services.verifier.api.client.index.Column in project drools-wb by kiegroup.
the class QueryableIndexTest method setUp.
@Before
public void setUp() throws Exception {
configuration = new AnalyzerConfigurationMock();
final Rules rules = new Rules();
rules.add(new Rule(0, configuration));
rules.add(new Rule(1, configuration));
rules.add(new Rule(2, configuration));
final Columns columns = new Columns();
firstColumn = new Column(0, configuration);
columns.add(firstColumn);
columns.add(new Column(1, configuration));
final ObjectTypes objectTypes = new ObjectTypes();
objectTypes.add(new ObjectType("Person", configuration));
objectTypes.add(new ObjectType("Address", configuration));
queryableIndex = new QueryableIndex(rules, columns, objectTypes);
}
Aggregations