use of org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionFieldValue in project drools-wb by kiegroup.
the class EditActionUpdatePopup method initialiseFieldValues.
private void initialiseFieldValues() {
containerFieldValues.clear();
addFieldValueButton.setEnabled(true);
for (ActionFieldValue afv : clone.getFieldValues()) {
final ActionFieldValueEditor afvEditor = new ActionFieldValueEditor(clone.getBoundNode().getClassName(), afv, clone.getFieldValues(), oracle, onDeleteCallback);
containerFieldValues.add(afvEditor);
}
}
use of org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionFieldValue in project drools-wb by kiegroup.
the class EditActionUpdatePopup method onAddFieldValueButtonClick.
@UiHandler("addFieldValueButton")
void onAddFieldValueButtonClick(final ClickEvent event) {
final ActionFieldValue afv = new ActionFieldValueImpl();
final ActionFieldValueEditor afvEditor = new ActionFieldValueEditor(clone.getBoundNode().getClassName(), afv, clone.getFieldValues(), oracle, onDeleteCallback);
containerFieldValues.add(afvEditor);
clone.getFieldValues().add(afv);
}
use of org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionFieldValue in project drools by kiegroup.
the class GuidedDecisionTreeModelMarshallingVisitor method generateActionModifyNodeDRL.
protected void generateActionModifyNodeDRL(final ActionUpdateNode an, final StringBuilder drl) {
final Iterator<ActionFieldValue> itr = an.getFieldValues().iterator();
if (!itr.hasNext()) {
return;
}
drl.append(INDENTATION).append(INDENTATION).append("modify( ").append(an.getBoundNode().getBinding()).append(" ) {\n");
while (itr.hasNext()) {
final ActionFieldValue afv = itr.next();
drl.append(INDENTATION).append(INDENTATION).append(INDENTATION);
drl.append("set");
drl.append(Character.toUpperCase(afv.getFieldName().charAt(0)));
drl.append(afv.getFieldName().substring(1));
drl.append("( ").append(generateRHSValueDRL(afv.getValue())).append(" )");
if (itr.hasNext()) {
drl.append(", ");
}
drl.append("\n");
}
drl.append(INDENTATION).append(INDENTATION).append("}\n");
}
Aggregations