use of org.drools.workbench.models.guided.dtable.shared.model.Pattern52 in project drools-wb by kiegroup.
the class ExtendedGuidedDecisionTableBuilder method withStringColumn.
public ExtendedGuidedDecisionTableBuilder withStringColumn(String boundName, String factType, String field, String operator) {
Pattern52 pattern = findPattern(boundName, factType);
ConditionCol52 con1 = new ConditionCol52();
con1.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
con1.setFieldType(DataType.TYPE_STRING);
con1.setFactField(field);
con1.setHeader("Applicant age");
con1.setOperator(operator);
pattern.getChildColumns().add(con1);
addPattern(pattern);
return this;
}
use of org.drools.workbench.models.guided.dtable.shared.model.Pattern52 in project drools-wb by kiegroup.
the class ExtendedGuidedDecisionTableBuilder method withConditionIntegerColumn.
public ExtendedGuidedDecisionTableBuilder withConditionIntegerColumn(String boundName, String factType, String field, String operator) {
Pattern52 pattern = findPattern(boundName, factType);
ConditionCol52 con1 = new ConditionCol52();
con1.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
con1.setFieldType(DataType.TYPE_NUMERIC_INTEGER);
con1.setFactField(field);
con1.setHeader("Applicant age");
con1.setOperator(operator);
pattern.getChildColumns().add(con1);
addPattern(pattern);
return this;
}
use of org.drools.workbench.models.guided.dtable.shared.model.Pattern52 in project drools-wb by kiegroup.
the class ExtendedGuidedDecisionTableBuilder method withNumericColumn.
public ExtendedGuidedDecisionTableBuilder withNumericColumn(String boundName, String factType, String field, String operator) {
Pattern52 pattern = findPattern(boundName, factType);
ConditionCol52 con1 = new ConditionCol52();
con1.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
con1.setFieldType(DataType.TYPE_NUMERIC);
con1.setFactField(field);
con1.setHeader("Applicant age");
con1.setOperator(operator);
pattern.getChildColumns().add(con1);
addPattern(pattern);
return this;
}
use of org.drools.workbench.models.guided.dtable.shared.model.Pattern52 in project drools-wb by kiegroup.
the class LimitedGuidedDecisionTableBuilder method withIntegerColumn.
public LimitedGuidedDecisionTableBuilder withIntegerColumn(final String boundName, final String factType, final String field, final String operator, final int value) {
final Pattern52 pattern = findPattern(boundName, factType);
final LimitedEntryConditionCol52 condition = new LimitedEntryConditionCol52();
condition.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
condition.setFieldType(DataType.TYPE_NUMERIC_INTEGER);
condition.setFactField(field);
condition.setHeader("Some header");
condition.setOperator(operator);
condition.setValue(new DTCellValue52() {
{
setNumericValue(new Integer(value));
}
});
pattern.getChildColumns().add(condition);
addPattern(pattern);
return this;
}
use of org.drools.workbench.models.guided.dtable.shared.model.Pattern52 in project drools-wb by kiegroup.
the class ModelMetaDataEnhancerTest method conditionCol52Column.
@Test
public void conditionCol52Column() throws Exception {
final ArrayList<BaseColumn> columns = new ArrayList<>();
final ConditionCol52 conditionCol52 = new ConditionCol52();
final Pattern52 pattern52 = new Pattern52();
columns.add(conditionCol52);
when(model.getExpandedColumns()).thenReturn(columns);
when(model.getPattern(conditionCol52)).thenReturn(pattern52);
final Map<Integer, ModelMetaData> metaData = new ModelMetaDataEnhancer(model).getHeaderMetaData().getPatternsByColumnNumber();
assertEquals(1, metaData.size());
assertEquals(pattern52, metaData.get(0).getPattern());
assertEquals(PatternType.LHS, metaData.get(0).getPatternType());
}
Aggregations