use of org.drools.workbench.services.verifier.api.client.index.Action 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.Action 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.Action in project drools-wb by kiegroup.
the class RuleBuilder method resolveColumns.
private void resolveColumns() throws BuildException {
int columnIndex = 0;
for (final BaseColumn baseColumn : model.getExpandedColumns()) {
if (baseColumn instanceof ConditionCol52) {
final Condition condition = builderFactory.getConditionBuilder().with((ConditionCol52) baseColumn).with(rule).with(row).with(columnIndex).build();
rule.getConditions().add(condition);
} else if (baseColumn instanceof ActionCol52) {
final Action action = builderFactory.getActionBuilder().with(rule).with((ActionCol52) baseColumn).with(row).with(columnIndex).build();
rule.getActions().add(action);
}
columnIndex++;
}
}
use of org.drools.workbench.services.verifier.api.client.index.Action in project drools-wb by kiegroup.
the class CellBuilder method build.
public void build() throws BuildException {
if (baseColumn instanceof ActionCol52) {
final Action action = builderFactory.getActionBuilder().with(rule).with(row).with(columnIndex).with((ActionCol52) baseColumn).build();
rule.getActions().add(action);
} else if (baseColumn instanceof ConditionCol52) {
if (baseColumn instanceof BRLConditionVariableColumn) {
final Condition condition = builderFactory.getBRLConditionBuilder().with((BRLConditionVariableColumn) baseColumn).with(getRealCellValue((BRLConditionVariableColumn) baseColumn, row.get(columnIndex))).with(columnIndex).build();
rule.getConditions().add(condition);
} else {
final Condition condition = builderFactory.getFieldConditionsBuilder().with(resolvePattern(rule)).with((ConditionCol52) baseColumn).with(getRealCellValue((ConditionCol52) baseColumn, row.get(columnIndex))).with(columnIndex).build();
rule.getConditions().add(condition);
}
}
}
use of org.drools.workbench.services.verifier.api.client.index.Action in project drools-wb by kiegroup.
the class FieldInspectorUpdateTest method makeAction.
private FieldAction makeAction(final Field field) {
final FieldAction fieldAction = new FieldAction(field, mock(Column.class), DataType.DataTypes.NUMERIC, new Values(11), configurationMock);
final ArrayList<Action> actionsList = new ArrayList<>();
actionsList.add(fieldAction);
final Actions actions = new Actions(actionsList);
when(field.getActions()).thenReturn(actions);
return fieldAction;
}
Aggregations