use of org.drools.workbench.models.datamodel.rule.InterpolationVariable in project drools-wb by kiegroup.
the class GuidedDecisionTablePopulater method createRHSChildColumns.
private void createRHSChildColumns(final RuleModel rm, final IAction action, final BRLActionColumn column, final List<BRLVariableColumn> variableColumns) {
final Map<InterpolationVariable, Integer> templateKeys = new HashMap<>();
final RuleModelVisitor rmv = new RuleModelVisitor(rm.lhs, templateKeys);
rmv.visit(action);
final List<InterpolationVariable> ivs = new ArrayList<>(templateKeys.keySet());
for (BRLVariableColumn variableColumn : variableColumns) {
final Iterator<InterpolationVariable> ivsIts = ivs.iterator();
while (ivsIts.hasNext()) {
final InterpolationVariable iv = ivsIts.next();
if (iv.getVarName().equals(variableColumn.getVarName())) {
final BRLActionVariableColumn source = (BRLActionVariableColumn) variableColumn;
final BRLActionVariableColumn target = makeBRLActionVariableColumn(source, iv);
column.getChildColumns().add(target);
ivsIts.remove();
}
}
}
}
Aggregations