use of org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities in project drools-wb by kiegroup.
the class AbstractGuidedDecisionTableWizardPage method setContent.
public void setContent(final Path contextPath, final String baseFileName, final GuidedDecisionTable52.TableFormat tableFormat, final GuidedDecisionTable52.HitPolicy hitPolicy, final AsyncPackageDataModelOracle oracle, final GuidedDecisionTable52 model, final Validator validator) {
this.contextPath = contextPath;
this.baseFileName = baseFileName;
this.tableFormat = tableFormat;
this.hitPolicy = hitPolicy;
this.oracle = oracle;
this.model = model;
this.validator = validator;
this.cellUtilities = new CellUtilities();
this.columnUtilities = new ColumnUtilities(model, oracle);
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities in project drools-wb by kiegroup.
the class BRLConditionColumnDefinitionBuilder method generateDefinition.
@Override
public void generateDefinition(final GuidedDecisionTableView.Presenter dtPresenter, final BaseColumn column, final Callback<String> afterGenerationCallback) {
if (!(column instanceof BRLConditionVariableColumn)) {
return;
}
final GuidedDecisionTable52 existingModel = dtPresenter.getModel();
final BRLConditionVariableColumn brlVariableColumn = (BRLConditionVariableColumn) column;
final BRLConditionColumn brlColumn = existingModel.getBRLColumn(brlVariableColumn);
final GuidedDecisionTable52 partialModel = new GuidedDecisionTable52();
final ColumnUtilities columnUtilities = new ColumnUtilities(existingModel, dtPresenter.getDataModelOracle());
partialModel.getConditions().add(brlColumn);
partialModel.getData().add(makeRowData(columnUtilities, brlColumn));
generateDefinitionOnServer(partialModel, dtPresenter.getCurrentPath(), (String drl) -> afterGenerationCallback.callback(getLHS(drl)));
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities in project drools-wb by kiegroup.
the class BaseConverterTest method setup.
@Before
public void setup() {
this.model = getModel();
this.oracle = getOracle();
this.presenter = getPresenter();
this.columnUtilities = new ColumnUtilities(model, oracle);
for (BaseColumnConverter bcc : getConverters()) {
bcc.initialise(model, oracle, columnUtilities, presenter);
}
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities in project drools-wb by kiegroup.
the class BaseActionColumnDefinitionBuilder method generateActionColumn.
protected void generateActionColumn(final GuidedDecisionTableView.Presenter dtPresenter, final BaseColumn column, final Callback<String> afterGenerationCallback) {
final GuidedDecisionTable52 existingModel = dtPresenter.getModel();
final GuidedDecisionTable52 partialModel = new GuidedDecisionTable52();
final ColumnUtilities columnUtilities = new ColumnUtilities(existingModel, dtPresenter.getDataModelOracle());
final ActionCol52 ac = (ActionCol52) column;
partialModel.getActionCols().add(ac);
partialModel.getData().add(makeRowData(columnUtilities, ac));
generateDefinitionOnServer(partialModel, dtPresenter.getCurrentPath(), (String drl) -> afterGenerationCallback.callback(getRHS(drl)));
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities in project drools-wb by kiegroup.
the class BaseConditionColumnDefinitionBuilder method generateConditionColumn.
protected void generateConditionColumn(final GuidedDecisionTableView.Presenter dtPresenter, final BaseColumn column, final Callback<String> afterGenerationCallback) {
final GuidedDecisionTable52 existingModel = dtPresenter.getModel();
final ConditionCol52 cc = (ConditionCol52) column;
if (!isConditionPartOfPattern(existingModel, cc)) {
return;
}
final GuidedDecisionTable52 partialModel = new GuidedDecisionTable52();
final ColumnUtilities columnUtilities = new ColumnUtilities(existingModel, dtPresenter.getDataModelOracle());
final Pattern52 p = existingModel.getPattern(cc).clonePattern();
p.getChildColumns().clear();
p.getChildColumns().add(cc);
partialModel.getConditions().add(p);
partialModel.getData().add(makeRowData(columnUtilities, cc));
generateDefinitionOnServer(partialModel, dtPresenter.getCurrentPath(), (String drl) -> afterGenerationCallback.callback(getLHS(drl)));
}
Aggregations