use of org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52 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.ConditionCol52 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.ConditionCol52 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.ConditionCol52 in project drools-wb by kiegroup.
the class ModelMetaDataEnhancer method getHeaderMetaData.
public HeaderMetaData getHeaderMetaData() {
int columnIndex = 0;
final Map<Integer, ModelMetaData> map = new HashMap<>();
for (final BaseColumn baseColumn : model.getExpandedColumns()) {
if (baseColumn instanceof ConditionCol52) {
map.put(columnIndex, new ModelMetaData(model.getPattern((ConditionCol52) baseColumn), PatternType.LHS));
} else if (baseColumn instanceof ActionInsertFactCol52) {
final ActionInsertFactCol52 aif = (ActionInsertFactCol52) baseColumn;
map.put(columnIndex, new ModelMetaData(aif.getFactType(), aif.getBoundName(), PatternType.RHS));
} else if (baseColumn instanceof ActionSetFieldCol52) {
final ActionSetFieldCol52 asf = (ActionSetFieldCol52) baseColumn;
map.put(columnIndex, new ModelMetaData(getFactType(asf), asf.getBoundName(), PatternType.RHS));
}
columnIndex++;
}
return new HeaderMetaData(map);
}
use of org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52 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++;
}
}
Aggregations