Search in sources :

Example 26 with FromCollectCompositeFactPattern

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);
}
Also used : FromCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromCompositeFactPattern) FromAccumulateCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromAccumulateCompositeFactPattern) FromEntryPointFactPattern(org.drools.workbench.models.datamodel.rule.FromEntryPointFactPattern) FromCollectCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern)

Example 27 with FromCollectCompositeFactPattern

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();
}
Also used : FromCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromCompositeFactPattern) FromEntryPointFactPattern(org.drools.workbench.models.datamodel.rule.FromEntryPointFactPattern) FactPattern(org.drools.workbench.models.datamodel.rule.FactPattern) FromAccumulateCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromAccumulateCompositeFactPattern) CompositeFactPattern(org.drools.workbench.models.datamodel.rule.CompositeFactPattern) FromCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromCompositeFactPattern) FromCollectCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern) FromCollectCompositeFactPattern(org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern) Test(org.junit.Test)

Aggregations

FromCollectCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern)27 FactPattern (org.drools.workbench.models.datamodel.rule.FactPattern)24 CompositeFactPattern (org.drools.workbench.models.datamodel.rule.CompositeFactPattern)20 Test (org.junit.Test)18 FromAccumulateCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromAccumulateCompositeFactPattern)15 FromCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromCompositeFactPattern)15 BaseSingleFieldConstraint (org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint)12 SingleFieldConstraint (org.drools.workbench.models.datamodel.rule.SingleFieldConstraint)12 FromEntryPointFactPattern (org.drools.workbench.models.datamodel.rule.FromEntryPointFactPattern)10 TemplateModel (org.drools.workbench.models.guided.template.shared.TemplateModel)10 RuleModel (org.drools.workbench.models.datamodel.rule.RuleModel)6 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)5 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)5 Widget (com.google.gwt.user.client.ui.Widget)5 FreeFormLine (org.drools.workbench.models.datamodel.rule.FreeFormLine)5 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)4 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)4 ExpressionFormLine (org.drools.workbench.models.datamodel.rule.ExpressionFormLine)4 ExpressionVariable (org.drools.workbench.models.datamodel.rule.ExpressionVariable)4 IPattern (org.drools.workbench.models.datamodel.rule.IPattern)4