Search in sources :

Example 1 with ExpressionGlobalVariable

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

the class CopyExpressionVisitor method visit.

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

Example 2 with ExpressionGlobalVariable

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

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