Search in sources :

Example 16 with ExpressionVariable

use of org.drools.workbench.models.datamodel.rule.ExpressionVariable in project drools by kiegroup.

the class CopyExpressionVisitorTest method testExpressionFormLineCopy.

@Test
public void testExpressionFormLineCopy() {
    ExpressionFormLine efl = new ExpressionFormLine();
    efl.appendPart(new ExpressionCollection("collection", "CT", "GT", "PT"));
    efl.appendPart(new ExpressionCollectionIndex("collectionIndex", "CT", "GT"));
    efl.appendPart(new ExpressionField("field", "CT", "FT", "PT"));
    efl.appendPart(new ExpressionFieldVariable("fieldVariable", "Type"));
    efl.appendPart(new ExpressionGlobalVariable("globalVariable", "CT", "GT", "PT"));
    efl.appendPart(new ExpressionMethod("method", "CT", "GT"));
    efl.appendPart(new ExpressionMethodParameter("methodParam", "CT", "GT"));
    efl.appendPart(new ExpressionText("text"));
    efl.appendPart(new ExpressionUnboundFact("FactType"));
    efl.appendPart(new ExpressionVariable("binding", "FactType"));
    // verify that the new instance created with copy constructor is equal to original
    assertEquals(efl, new ExpressionFormLine(efl));
}
Also used : ExpressionFormLine(org.drools.workbench.models.datamodel.rule.ExpressionFormLine) ExpressionFieldVariable(org.drools.workbench.models.datamodel.rule.ExpressionFieldVariable) ExpressionMethod(org.drools.workbench.models.datamodel.rule.ExpressionMethod) ExpressionCollectionIndex(org.drools.workbench.models.datamodel.rule.ExpressionCollectionIndex) ExpressionMethodParameter(org.drools.workbench.models.datamodel.rule.ExpressionMethodParameter) ExpressionCollection(org.drools.workbench.models.datamodel.rule.ExpressionCollection) ExpressionText(org.drools.workbench.models.datamodel.rule.ExpressionText) ExpressionVariable(org.drools.workbench.models.datamodel.rule.ExpressionVariable) ExpressionField(org.drools.workbench.models.datamodel.rule.ExpressionField) ExpressionUnboundFact(org.drools.workbench.models.datamodel.rule.ExpressionUnboundFact) ExpressionGlobalVariable(org.drools.workbench.models.datamodel.rule.ExpressionGlobalVariable) Test(org.junit.Test)

Aggregations

ExpressionVariable (org.drools.workbench.models.datamodel.rule.ExpressionVariable)16 FactPattern (org.drools.workbench.models.datamodel.rule.FactPattern)14 CompositeFactPattern (org.drools.workbench.models.datamodel.rule.CompositeFactPattern)13 FromAccumulateCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromAccumulateCompositeFactPattern)13 FromCollectCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern)13 FromCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromCompositeFactPattern)13 Test (org.junit.Test)13 ExpressionFormLine (org.drools.workbench.models.datamodel.rule.ExpressionFormLine)10 RuleModel (org.drools.workbench.models.datamodel.rule.RuleModel)10 ExpressionText (org.drools.workbench.models.datamodel.rule.ExpressionText)6 FromEntryPointFactPattern (org.drools.workbench.models.datamodel.rule.FromEntryPointFactPattern)6 BaseSingleFieldConstraint (org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint)5 ExpressionField (org.drools.workbench.models.datamodel.rule.ExpressionField)5 IPattern (org.drools.workbench.models.datamodel.rule.IPattern)5 SingleFieldConstraint (org.drools.workbench.models.datamodel.rule.SingleFieldConstraint)5 ExpressionMethod (org.drools.workbench.models.datamodel.rule.ExpressionMethod)3 ExpressionFieldVariable (org.drools.workbench.models.datamodel.rule.ExpressionFieldVariable)2 ExpressionUnboundFact (org.drools.workbench.models.datamodel.rule.ExpressionUnboundFact)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1