@Override protected String[] getReservedAttributes() { int size = model.attributes.length; String[] duplicates = new String[size]; for (int i = 0; i < size; i++) { duplicates[i] = model.attributes[i].getAttributeName(); } return duplicates; }
@Override protected String[] getReservedAttributes() { int size = model.attributes.length; String[] duplicates = new String[size]; for (int i = 0; i < size; i++) { duplicates[i] = model.attributes[i].getAttributeName(); } return duplicates; }
private String getRuleDialect() { final RuleModel model = getModeller().getModel(); for (int i = 0; i < model.attributes.length; i++) { RuleAttribute attr = model.attributes[i]; if (attr.getAttributeName().equals("dialect")) { return attr.getValue(); } } return DRLConstraintValueBuilder.DEFAULT_DIALECT; }
private String getRuleDialect() { final RuleModel model = getModeller().getModel(); for (int i = 0; i < model.attributes.length; i++) { RuleAttribute attr = model.attributes[i]; if (attr.getAttributeName().equals("dialect")) { return attr.getValue(); } } return DRLConstraintValueBuilder.DEFAULT_DIALECT; }
/** * Marshal model attributes * @param buf * @param model */ protected void marshalAttributes(final StringBuilder buf, final RuleModel model) { boolean hasDialect = false; for (int i = 0; i < model.attributes.length; i++) { RuleAttribute attr = model.attributes[i]; buf.append("\t"); buf.append(attr); buf.append("\n"); if (attr.getAttributeName().equals("dialect")) { constraintValueBuilder = DRLConstraintValueBuilder.getBuilder(attr.getValue()); hasDialect = true; } } // Un comment below for mvel if (!hasDialect) { RuleAttribute attr = new RuleAttribute("dialect", DRLConstraintValueBuilder.DEFAULT_DIALECT); buf.append("\t"); buf.append(attr); buf.append("\n"); } }
private RuleAttribute visitRuleAttribute(RuleAttribute attr) { RuleAttribute clone = new RuleAttribute(); clone.setAttributeName(attr.getAttributeName()); clone.setValue(attr.getValue()); return clone; }
private RuleAttribute visitRuleAttribute(RuleAttribute attr) { RuleAttribute clone = new RuleAttribute(); clone.setAttributeName(attr.getAttributeName()); clone.setValue(attr.getValue()); return clone; }
private void visitRuleAttribute(final RuleAttribute attr) { PartType type = PartType.getPartTypeFromAttribueDescrName(attr.getAttributeName()); switch (type) { case AGENDA_GROUP: case ACTIVATION_GROUP: case RULEFLOW_GROUP: case ENTRY_POINT: SharedPart sharedRef = new SharedPart(attr.getValue(), type); builder.addGenerator(sharedRef); break; // OCRAM: finish default: // logger.info("Not processing attribute: " + descr.getName()); } }
private void visitRuleAttribute(final RuleAttribute attr) { PartType type = PartType.getPartTypeFromAttribueDescrName(attr.getAttributeName()); switch (type) { case AGENDA_GROUP: case ACTIVATION_GROUP: case RULEFLOW_GROUP: case ENTRY_POINT: SharedPart sharedRef = new SharedPart(attr.getValue(), type); builder.addGenerator(sharedRef); break; // OCRAM: finish default: // logger.info("Not processing attribute: " + descr.getName()); } }
final EditAttributeWidgetFactory editAttributeWidgetFactory = new EditAttributeWidgetFactory(isReadOnly); final String attributeName = at.getAttributeName(); if (attributeName.equals(RULEFLOW_GROUP_ATTR) || attributeName.equals(AGENDA_GROUP_ATTR)
final EditAttributeWidgetFactory editAttributeWidgetFactory = new EditAttributeWidgetFactory(isReadOnly); final String attributeName = at.getAttributeName(); if (attributeName.equals(RULEFLOW_GROUP_ATTR) || attributeName.equals(AGENDA_GROUP_ATTR)
layout.addAttribute(at.getAttributeName(), getEditorWidget(at, i,
rm.attributes.length); assertEquals("salience", rm.attributes[0].getAttributeName()); assertEquals("a", rm.attributes[0].getValue()); rm.attributes.length); assertEquals("salience", rm.attributes[0].getAttributeName()); assertEquals("1", rm.attributes[0].getValue()); assertEquals("agenda-group", rm.attributes[1].getAttributeName()); assertEquals("b", rm.attributes[1].getValue());
layout.addAttribute(at.getAttributeName(), getEditorWidget(at, i,
@Test public void testRoundTrip() { final TemplateModel m = getComplexModel(); final String xml = RuleTemplateModelXMLPersistenceImpl.getInstance().marshal(m); final TemplateModel m2 = RuleTemplateModelXMLPersistenceImpl.getInstance().unmarshal(xml); assertNotNull(m2); assertEquals(m.name, m2.name); assertEquals(m.lhs.length, m2.lhs.length); assertEquals(m.rhs.length, m2.rhs.length); assertEquals(1, m.attributes.length); final RuleAttribute at = m.attributes[0]; assertEquals("no-loop", at.getAttributeName()); assertEquals("true", at.getValue()); final String newXML = RuleTemplateModelXMLPersistenceImpl.getInstance().marshal(m2); assertEquals(xml, newXML); }