private void visitActionFieldList(final String fullyQualifiedClassName, final ActionSetField afl) { for (ActionFieldValue afv : afl.getFieldValues()) { visit(fullyQualifiedClassName, afv); } }
private void visitActionFieldList(final String fullyQualifiedClassName, final ActionSetField afl) { for (ActionFieldValue afv : afl.getFieldValues()) { visit(fullyQualifiedClassName, afv); } }
public void visitActionSetField(final ActionSetField action) { if (action instanceof ActionCallMethod) { this.generateSetMethodCallsMethod((ActionCallMethod) action, action.getFieldValues()); } else { this.generateSetMethodCalls(action.getVariable(), action.getFieldValues()); } }
private void visitActionFieldList(ActionSetField afl) { String factType = model.getLHSBindingType(afl.getVariable()); for (ActionFieldValue afv : afl.getFieldValues()) { InterpolationVariable var = new InterpolationVariable(afv.getValue(), afv.getType(), factType, afv.getField()); if (afv.getNature() == FieldNatureType.TYPE_TEMPLATE && !vars.containsKey(var)) { vars.put(var, vars.size()); } } }
(asf instanceof ActionUpdateField))); } else { final List<ActionFieldValue> existingActionFieldValue = new ArrayList<ActionFieldValue>(Arrays.asList(afw.getAction().getFieldValues())); for (ActionFieldValue afv : asf.getFieldValues()) { existingActionFieldValue.add(afv);
@Before public void setUp() throws Exception { doReturn(oracle).when(modeller).getDataModelOracle(); doReturn(ruleModel).when(modeller).getModel(); doReturn(new ActionFieldValue[0]).when(action).getFieldValues(); testedWidget = spy(new ActionSetFieldWidget(modeller, eventBus, action, false)); }
private void visitActionFieldList(final ActionSetField afl) { String factType = model.getLHSBindingType(afl.getVariable()); for (ActionFieldValue afv : afl.getFieldValues()) { InterpolationVariable var = new InterpolationVariable(afv.getValue(), afv.getType(), factType, afv.getField()); if (afv.getNature() == FieldNatureType.TYPE_TEMPLATE && !vars.contains(var)) { vars.add(var); } else { hasNonTemplateOutput = true; } } }
@Before public void setUp() throws Exception { doReturn(oracle).when(modeller).getDataModelOracle(); doReturn(ruleModel).when(modeller).getModel(); doReturn(new ActionFieldValue[0]).when(action).getFieldValues(); testedWidget = spy(new ActionSetFieldWidget(modeller, eventBus, action, false)); }
private ActionSetField visitActionFieldList(ActionSetField afl) { ActionSetField clone = new ActionSetField(); clone.setVariable(afl.getVariable()); for (ActionFieldValue afv : afl.getFieldValues()) { clone.addFieldValue(cloneActionFieldValue(afv)); } return clone; }
private ActionSetField visitActionFieldList(ActionSetField afl) { ActionSetField clone = new ActionSetField(); clone.setVariable(afl.getVariable()); for (ActionFieldValue afv : afl.getFieldValues()) { clone.addFieldValue(cloneActionFieldValue(afv)); } return clone; }
private void doLayout() { layout.clear(); for (int i = 0; i < model.getFieldValues().length; i++) { ActionFieldValue val = model.getFieldValues()[i]; if (model.getFieldValues().length == 0) { HorizontalPanel h = new HorizontalPanel(); h.add(getSetterLabel());
update.setFieldValues(old.getFieldValues()); a.action = update;
private void doLayout() { layout.clear(); for (int i = 0; i < model.getFieldValues().length; i++) { ActionFieldValue val = model.getFieldValues()[i]; if (model.getFieldValues().length == 0) { HorizontalPanel h = new HorizontalPanel(); h.add(getSetterLabel());
if (tn.getBinding().equals(binding)) { final ActionUpdateNode aun = new ActionUpdateNodeImpl(tn); for (org.drools.workbench.models.datamodel.rule.ActionFieldValue afv : asf.getFieldValues()) { if (afv.getNature() != FieldNatureType.TYPE_LITERAL) { messages.add(new UnsupportedFieldNatureTypeParserMessage());
ActionValueEditor valueEditor(final ActionFieldValue actionFieldValue) { AsyncPackageDataModelOracle oracle = this.getModeller().getDataModelOracle(); String type = ""; if (oracle.isGlobalVariable(this.model.getVariable())) { type = oracle.getGlobalVariable(this.model.getVariable()); } else { type = this.getModeller().getModel().getLHSBindingType(this.model.getVariable()); /* * to take in account if the using a rhs bound variable */ if (type == null && !this.readOnly) { type = this.getModeller().getModel().getRHSBoundFact(this.model.getVariable()).getFactType(); } } ActionValueEditor actionValueEditor = actionValueEditor(type, actionFieldValue, model.getFieldValues(), readOnly); actionValueEditor.setOnChangeCommand(new Command() { public void execute() { RefreshUtil.refreshActionValueEditorsDropDownData(actionValueEditors, actionFieldValue); setModified(true); } }); //Keep a reference to the value editors so they can be refreshed for dependent enums actionValueEditors.put(actionFieldValue, actionValueEditor); return actionValueEditor; }
ActionValueEditor valueEditor(final ActionFieldValue actionFieldValue) { AsyncPackageDataModelOracle oracle = this.getModeller().getDataModelOracle(); String type = ""; if (oracle.isGlobalVariable(this.model.getVariable())) { type = oracle.getGlobalVariable(this.model.getVariable()); } else { type = this.getModeller().getModel().getLHSBindingType(this.model.getVariable()); /* * to take in account if the using a rhs bound variable */ if (type == null && !this.readOnly) { type = this.getModeller().getModel().getRHSBoundFact(this.model.getVariable()).getFactType(); } } ActionValueEditor actionValueEditor = actionValueEditor(type, actionFieldValue, model.getFieldValues(), readOnly); actionValueEditor.setOnChangeCommand(new Command() { public void execute() { RefreshUtil.refreshActionValueEditorsDropDownData(actionValueEditors, actionFieldValue); setModified(true); } }); //Keep a reference to the value editors so they can be refreshed for dependent enums actionValueEditors.put(actionFieldValue, actionValueEditor); return actionValueEditor; }
private void doAction(List<LabelledAction> actions, ActionSetFieldCol52 sf, String cell) { LabelledAction a = findByLabelledAction(actions, sf.getBoundName(), sf.isUpdate()); if (a == null) { a = new LabelledAction(); a.boundName = sf.getBoundName(); a.isUpdate = sf.isUpdate(); if (!sf.isUpdate()) { a.action = new ActionSetField(sf.getBoundName()); } else { a.action = new ActionUpdateField(sf.getBoundName()); } actions.add(a); } else if (sf.isUpdate() && !(a.action instanceof ActionUpdateField)) { // lets swap it out for an update as the user has asked for it. ActionSetField old = (ActionSetField) a.action; ActionUpdateField update = new ActionUpdateField(sf.getBoundName()); update.setFieldValues(old.getFieldValues()); a.action = update; } ActionSetField asf = (ActionSetField) a.action; ActionFieldValue val = new ActionFieldValue(sf.getFactField(), cell, sf.getType()); asf.addFieldValue(val); }
private ActionSetField clone(final ActionSetField action) { if (action instanceof ActionUpdateField) { final ActionUpdateField auf = (ActionUpdateField) action; final ActionUpdateField clone = new ActionUpdateField(auf.getVariable()); clone.setFieldValues(auf.getFieldValues()); return clone; } else if (action instanceof ActionCallMethod) { final ActionCallMethod acm = (ActionCallMethod) action; final ActionCallMethod clone = new ActionCallMethod(acm.getVariable()); clone.setState(acm.getState()); clone.setMethodName(acm.getMethodName()); clone.setFieldValues(acm.getFieldValues()); return clone; } else if (action instanceof ActionSetField) { final ActionSetField clone = new ActionSetField(action.getVariable()); clone.setFieldValues(action.getFieldValues()); return clone; } else { return action; } } }
a1.getVariable()); assertEquals(1, a1.getFieldValues().length); a1.getFieldValues()[0].getField()); assertEquals("actionsetfield1", a1.getFieldValues()[0].getValue()); assertEquals(DataType.TYPE_STRING, a1.getFieldValues()[0].getType()); a2.getVariable()); assertEquals(1, a2.getFieldValues().length); a2.getFieldValues()[0].getField()); assertEquals("actionupdatefield2", a2.getFieldValues()[0].getValue()); assertEquals(DataType.TYPE_NUMERIC_INTEGER, a2.getFieldValues()[0].getType());
"$r"); assertEquals(1, asf.getFieldValues().length); ActionFieldValue fv1 = asf.getFieldValues()[0]; assertNotNull(fv1); assertTrue(fv1 instanceof ActionWorkItemFieldValue);