use of org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern in project drools-wb by kiegroup.
the class RuleModellerConditionSelectorPopup method addNewFCE.
private void addNewFCE(String type, int position) {
FromCompositeFactPattern p = null;
if (type.equals("from")) {
p = new FromCompositeFactPattern();
} else if (type.equals("from accumulate")) {
p = new FromAccumulateCompositeFactPattern();
} else if (type.equals("from collect")) {
p = new FromCollectCompositeFactPattern();
} else if (type.equals("from entry-point")) {
p = new FromEntryPointFactPattern();
}
this.model.addLhsItem(p, position);
}
use of org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern in project drools-wb by kiegroup.
the class GuidedRuleEditorValidatorTest method testMissingValueInFromCollect.
@Test
public void testMissingValueInFromCollect() throws Exception {
FactPattern pattern = new FactPattern("Person");
pattern.setBoundName("person");
FromCompositeFactPattern fromCompositeFactPattern = new FromCollectCompositeFactPattern();
fromCompositeFactPattern.setFactPattern(pattern);
model.lhs = new IPattern[] { fromCompositeFactPattern };
assertFalse(validator.isValid());
assertEquals(1, validator.getErrors().size());
assertEquals(MISSING_FACT_PATTERN, validator.getErrors().get(0));
verify(constants).AreasMarkedWithRedAreMandatoryPleaseSetAValueBeforeSaving();
}
Aggregations