Search in sources :

Example 1 with ExpressionCollectionIndex

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

the class CopyExpressionVisitor method visit.

public void visit(ExpressionCollectionIndex part) {
    ExpressionCollectionIndex method = new ExpressionCollectionIndex(part.getName(), part.getClassType(), part.getGenericType(), part.getParametricType());
    copyMethodParams(part, method);
    add(method);
    moveNext(part);
}
Also used : ExpressionCollectionIndex(org.drools.workbench.models.datamodel.rule.ExpressionCollectionIndex)

Example 2 with ExpressionCollectionIndex

use of org.drools.workbench.models.datamodel.rule.ExpressionCollectionIndex 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)

Example 3 with ExpressionCollectionIndex

use of org.drools.workbench.models.datamodel.rule.ExpressionCollectionIndex in project drools-wb by kiegroup.

the class RuleModelCloneVisitorTest method buildExpressionFormLine.

private static ExpressionFormLine buildExpressionFormLine() {
    ExpressionFormLine efl = new ExpressionFormLine();
    efl.setBinding("eflBinding");
    efl.appendPart(new ExpressionText("text"));
    efl.appendPart(new ExpressionCollectionIndex("collectionIndex", "CT", "GT"));
    return efl;
}
Also used : ExpressionFormLine(org.drools.workbench.models.datamodel.rule.ExpressionFormLine) ExpressionCollectionIndex(org.drools.workbench.models.datamodel.rule.ExpressionCollectionIndex) ExpressionText(org.drools.workbench.models.datamodel.rule.ExpressionText)

Aggregations

ExpressionCollectionIndex (org.drools.workbench.models.datamodel.rule.ExpressionCollectionIndex)3 ExpressionFormLine (org.drools.workbench.models.datamodel.rule.ExpressionFormLine)2 ExpressionText (org.drools.workbench.models.datamodel.rule.ExpressionText)2 ExpressionCollection (org.drools.workbench.models.datamodel.rule.ExpressionCollection)1 ExpressionField (org.drools.workbench.models.datamodel.rule.ExpressionField)1 ExpressionFieldVariable (org.drools.workbench.models.datamodel.rule.ExpressionFieldVariable)1 ExpressionGlobalVariable (org.drools.workbench.models.datamodel.rule.ExpressionGlobalVariable)1 ExpressionMethod (org.drools.workbench.models.datamodel.rule.ExpressionMethod)1 ExpressionMethodParameter (org.drools.workbench.models.datamodel.rule.ExpressionMethodParameter)1 ExpressionUnboundFact (org.drools.workbench.models.datamodel.rule.ExpressionUnboundFact)1 ExpressionVariable (org.drools.workbench.models.datamodel.rule.ExpressionVariable)1 Test (org.junit.Test)1