Search in sources :

Example 6 with ActionFieldValue

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);
    }
}
Also used : ActionFieldValue(org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionFieldValue)

Example 7 with ActionFieldValue

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);
}
Also used : ActionFieldValue(org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionFieldValue) ActionFieldValueImpl(org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionFieldValueImpl) UiHandler(com.google.gwt.uibinder.client.UiHandler)

Example 8 with ActionFieldValue

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");
}
Also used : ActionFieldValue(org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionFieldValue)

Aggregations

ActionFieldValue (org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionFieldValue)8 ActionFieldValueImpl (org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionFieldValueImpl)3 UiHandler (com.google.gwt.uibinder.client.UiHandler)2 ConstraintNode (org.drools.workbench.models.guided.dtree.shared.model.nodes.ConstraintNode)2 TypeNode (org.drools.workbench.models.guided.dtree.shared.model.nodes.TypeNode)2 ArrayList (java.util.ArrayList)1 ActionInsertFact (org.drools.workbench.models.datamodel.rule.ActionInsertFact)1 ActionInsertLogicalFact (org.drools.workbench.models.datamodel.rule.ActionInsertLogicalFact)1 ActionRetractFact (org.drools.workbench.models.datamodel.rule.ActionRetractFact)1 ActionSetField (org.drools.workbench.models.datamodel.rule.ActionSetField)1 ActionUpdateField (org.drools.workbench.models.datamodel.rule.ActionUpdateField)1 ActionInsertNode (org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionInsertNode)1 ActionRetractNode (org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionRetractNode)1 ActionUpdateNode (org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionUpdateNode)1 Node (org.drools.workbench.models.guided.dtree.shared.model.nodes.Node)1 ActionInsertNodeImpl (org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionInsertNodeImpl)1 ActionRetractNodeImpl (org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionRetractNodeImpl)1 ActionUpdateNodeImpl (org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionUpdateNodeImpl)1 BindingNotFoundParserMessage (org.drools.workbench.models.guided.dtree.shared.model.parser.messages.BindingNotFoundParserMessage)1 UnsupportedFieldNatureTypeParserMessage (org.drools.workbench.models.guided.dtree.shared.model.parser.messages.UnsupportedFieldNatureTypeParserMessage)1