protected void fixActionInsertFactBindings(final IAction[] rhs) { final Set<String> existingBindings = extractExistingActionBindings(rhs); for (IAction action : rhs) { if (action instanceof ActionInsertFact) { final ActionInsertFact aif = (ActionInsertFact) action; if (aif.getFieldValues().length > 0 && aif.getBoundName() == null) { int idx = 0; String binding = "fact" + idx; while (existingBindings.contains(binding)) { idx++; binding = "fact" + idx; } existingBindings.add(binding); aif.setBoundName(binding); } } } }
public void onClick(ClickEvent event) { String var = varName.getText(); if (getModeller().isVariableNameUsed(var) && ((model.getBoundName() != null && model.getBoundName().equals(var) == false) || model.getBoundName() == null)) { Window.alert(GuidedRuleEditorResources.CONSTANTS.TheVariableName0IsAlreadyTaken(var)); return; } model.setBoundName(var); setModified(true); getModeller().refreshWidget(); popup.hide(); } });
public void onClick(ClickEvent event) { String var = varName.getText(); if (getModeller().isVariableNameUsed(var) && ((model.getBoundName() != null && model.getBoundName().equals(var) == false) || model.getBoundName() == null)) { Window.alert(GuidedRuleEditorResources.CONSTANTS.TheVariableName0IsAlreadyTaken(var)); return; } model.setBoundName(var); setModified(true); getModeller().refreshWidget(); popup.hide(); } });
private void doAction(List<LabelledAction> actions, ActionWorkItemInsertFactCol52 ac, String cell) { if (Boolean.TRUE.equals(Boolean.parseBoolean(cell))) { LabelledAction a = findByLabelledAction(actions, ac.getBoundName()); if (a == null) { a = new LabelledAction(); a.boundName = ac.getBoundName(); if (!ac.isInsertLogical()) { ActionInsertFact ins = new ActionInsertFact(ac.getFactType()); ins.setBoundName(ac.getBoundName()); a.action = ins; } else { ActionInsertLogicalFact ins = new ActionInsertLogicalFact(ac.getFactType()); ins.setBoundName(ac.getBoundName()); a.action = ins; } actions.add(a); } ActionInsertFact ins = (ActionInsertFact) a.action; ActionWorkItemFieldValue val = new ActionWorkItemFieldValue(ac.getFactField(), ac.getType(), ac.getWorkItemName(), ac.getWorkItemResultParameterName(), ac.getParameterClassName()); ins.addFieldValue(val); } }
private void setupBRLActionColumn() { final BRLActionColumn brl = new BRLActionColumn(); final ActionInsertFact ifc1 = new ActionInsertFact(); ifc1.setFactType("Person"); ifc1.setBoundName("$a"); final ActionFieldValue afv1 = new ActionFieldValue(); afv1.setNature(FieldNatureType.TYPE_TEMPLATE); afv1.setField("name"); afv1.setValue("f1"); ifc1.addFieldValue(afv1); final ActionFieldValue afv2 = new ActionFieldValue(); afv2.setNature(FieldNatureType.TYPE_TEMPLATE); afv2.setField("age"); afv2.setValue("f2"); ifc1.addFieldValue(afv2); brl.getDefinition().add(ifc1); brl.getChildColumns().add(new BRLActionVariableColumn("f1", DataType.TYPE_STRING)); brl.getChildColumns().add(new BRLActionVariableColumn("f2", DataType.TYPE_NUMERIC_INTEGER)); model.getActionCols().add(brl); when(dmo.getFieldType(eq("Person"), eq("name"))).thenReturn(DataType.TYPE_STRING); when(dmo.getFieldType(eq("Person"), eq("age"))).thenReturn(DataType.TYPE_NUMERIC_INTEGER); } }
private void doAction(List<LabelledAction> actions, ActionInsertFactCol52 ac, String cell) { LabelledAction a = findByLabelledAction(actions, ac.getBoundName()); if (a == null) { a = new LabelledAction(); a.boundName = ac.getBoundName(); if (!ac.isInsertLogical()) { ActionInsertFact ins = new ActionInsertFact(ac.getFactType()); ins.setBoundName(ac.getBoundName()); a.action = ins; } else { ActionInsertLogicalFact ins = new ActionInsertLogicalFact(ac.getFactType()); ins.setBoundName(ac.getBoundName()); a.action = ins; } actions.add(a); } ActionInsertFact ins = (ActionInsertFact) a.action; ActionFieldValue val = new ActionFieldValue(ac.getFactField(), cell, ac.getType()); ins.addFieldValue(val); }
private ActionInsertFact visitActionFieldList(ActionInsertFact afl) { ActionInsertFact clone = new ActionInsertFact(); clone.setFactType(afl.getFactType()); clone.setBoundName(afl.getBoundName()); for (ActionFieldValue afv : afl.getFieldValues()) { ActionFieldValue afvClone = new ActionFieldValue(); afvClone.setField(afv.getField()); afvClone.setNature(afv.getNature()); afvClone.setType(afv.getType()); afvClone.setValue(afv.getValue()); clone.addFieldValue(afvClone); } return clone; }
private ActionInsertFact visitActionFieldList(ActionInsertFact afl) { ActionInsertFact clone = new ActionInsertFact(); clone.setFactType(afl.getFactType()); clone.setBoundName(afl.getBoundName()); for (ActionFieldValue afv : afl.getFieldValues()) { ActionFieldValue afvClone = new ActionFieldValue(); afvClone.setField(afv.getField()); afvClone.setNature(afv.getNature()); afvClone.setType(afv.getType()); afvClone.setValue(afv.getValue()); clone.addFieldValue(afvClone); } return clone; }
ifc1.setBoundName("$a"); final ActionFieldValue afv1 = new ActionFieldValue(); afv1.setNature(FieldNatureType.TYPE_TEMPLATE); ifc2.setBoundName("$m"); final ActionFieldValue afv2 = new ActionFieldValue(); afv2.setNature(FieldNatureType.TYPE_TEMPLATE);
ifc1.setBoundName("$a"); final ActionFieldValue afv1 = new ActionFieldValue(); afv1.setNature(FieldNatureType.TYPE_TEMPLATE); ifc2.setBoundName("$m"); final ActionFieldValue afv2 = new ActionFieldValue(); afv2.setNature(FieldNatureType.TYPE_TEMPLATE);
aif.setBoundName("$aif"); aif.addFieldValue(new ActionFieldValue("rating", null,
ifc1.setBoundName("$a"); final ActionFieldValue afv1 = new ActionFieldValue(); afv1.setNature(FieldNatureType.TYPE_TEMPLATE); ifc2.setBoundName("$m"); final ActionFieldValue afv2 = new ActionFieldValue(); afv2.setNature(FieldNatureType.TYPE_TEMPLATE);
aif1.setBoundName("$aif"); aif1.addFieldValue(new ActionFieldValue("rating", null, aif2.setBoundName("$aif"); aif2.addFieldValue(new ActionFieldValue("rating", null,
aif.setBoundName("f0"); ActionFieldValue afv0 = new ActionFieldValue(); afv0.setNature(FieldNatureType.TYPE_TEMPLATE);
aif.setBoundName("f0"); ActionFieldValue afv0 = new ActionFieldValue(); afv0.setNature(FieldNatureType.TYPE_TEMPLATE);
aif.setBoundName("f0"); ActionFieldValue afv0 = new ActionFieldValue(); afv0.setNature(FieldNatureType.TYPE_TEMPLATE);
aif.setBoundName("f0"); ActionFieldValue afv0 = new ActionFieldValue(); afv0.setNature(FieldNatureType.TYPE_TEMPLATE);
aif.setBoundName("$aif"); aif.addFieldValue(new ActionFieldValue("rating", null,
aif.setBoundName("$aif"); aif.addFieldValue(new ActionFieldValue("rating", null,
aif.setBoundName( "$f" ); aif.setFactType( "FactType" ); aif.addFieldValue( buildActionFieldValue() );