Search in sources :

Example 1 with VerifierColumnUtilities

use of org.drools.workbench.services.verifier.plugin.client.builders.VerifierColumnUtilities in project drools-wb by kiegroup.

the class DTableUpdateManager method makeRule.

public void makeRule(final GuidedDecisionTable52 model, final HeaderMetaData headerMetaData, final FactTypes factTypes, final int rowIndex) throws BuildException {
    PortablePreconditions.checkNotNull("model", model);
    PortablePreconditions.checkNotNull("fieldTypes", factTypes);
    PortablePreconditions.checkNotNull("index", rowIndex);
    final Rule rule = new BuilderFactory(new VerifierColumnUtilities(model, headerMetaData, factTypes), this.index, model, headerMetaData, configuration).getRuleBuilder().with(rowIndex).build();
    analyzer.newRule(rule);
    analyzer.analyze();
}
Also used : Rule(org.drools.workbench.services.verifier.api.client.index.Rule) VerifierColumnUtilities(org.drools.workbench.services.verifier.plugin.client.builders.VerifierColumnUtilities) BuilderFactory(org.drools.workbench.services.verifier.plugin.client.builders.BuilderFactory)

Example 2 with VerifierColumnUtilities

use of org.drools.workbench.services.verifier.plugin.client.builders.VerifierColumnUtilities 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();
}
Also used : BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn) Column(org.drools.workbench.services.verifier.api.client.index.Column) BaseColumn(org.drools.workbench.models.guided.dtable.shared.model.BaseColumn) Rule(org.drools.workbench.services.verifier.api.client.index.Rule) VerifierColumnUtilities(org.drools.workbench.services.verifier.plugin.client.builders.VerifierColumnUtilities) DTCellValue52(org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52) BuilderFactory(org.drools.workbench.services.verifier.plugin.client.builders.BuilderFactory)

Aggregations

Rule (org.drools.workbench.services.verifier.api.client.index.Rule)2 BuilderFactory (org.drools.workbench.services.verifier.plugin.client.builders.BuilderFactory)2 VerifierColumnUtilities (org.drools.workbench.services.verifier.plugin.client.builders.VerifierColumnUtilities)2 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)1 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)1 Column (org.drools.workbench.services.verifier.api.client.index.Column)1