Package org.drools.workbench.models.datamodel.rule

Examples of org.drools.workbench.models.datamodel.rule.ExpressionVariable


                      ebLeftSide.getValue() );

        assertEquals( 3, ebLeftSide.getExpressionValue().getParts().size() );

        assertTrue( ebLeftSide.getExpressionValue().getParts().get( 0 ) instanceof ExpressionVariable );
        ExpressionVariable expressionVariable = (ExpressionVariable) ebLeftSide.getExpressionValue().getParts().get( 0 );
        assertEquals( "p",
                      expressionVariable.getName() );
        assertEquals( "org.test.Person",
                      expressionVariable.getClassType() );
        assertEquals( DataType.TYPE_THIS,
                      expressionVariable.getGenericType() );

        assertTrue( ebLeftSide.getExpressionValue().getParts().get( 1 ) instanceof ExpressionField );
        ExpressionField ef1 = (ExpressionField) ebLeftSide.getExpressionValue().getParts().get( 1 );
        assertEquals( "address",
                      ef1.getName() );
View Full Code Here


        assertEquals( BaseSingleFieldConstraint.TYPE_EXPR_BUILDER_VALUE, constraint.getConstraintValueType() );
        assertEquals( "", constraint.getValue() );
        assertEquals( 2, constraint.getExpressionValue().getParts().size() );

        assertTrue( constraint.getExpressionValue().getParts().get( 0 ) instanceof ExpressionVariable );
        ExpressionVariable expressionVariable = (ExpressionVariable) constraint.getExpressionValue().getParts().get( 0 );
        assertEquals( "a", expressionVariable.getName() );
        assertEquals( "Applicant", expressionVariable.getClassType() );
        assertEquals( "this", expressionVariable.getGenericType() );
        assertEquals( constraint.getExpressionValue().getParts().get( 1 ), expressionVariable.getNext() );

        assertTrue( constraint.getExpressionValue().getParts().get( 1 ) instanceof ExpressionField );
        ExpressionField expressionField = (ExpressionField) constraint.getExpressionValue().getParts().get( 1 );
        assertEquals( "age", expressionField.getName() );
        assertEquals( "java.lang.Integer", expressionField.getClassType() );
View Full Code Here

        assertEquals( 2,
                      efl1.getParts().size() );
        assertTrue( efl1.getParts().get( 0 ) instanceof ExpressionVariable );
        assertTrue( efl1.getParts().get( 1 ) instanceof ExpressionField );

        ExpressionVariable eflv1 = (ExpressionVariable) efl1.getParts().get( 0 );
        assertEquals( "cc",
                      eflv1.getName() );
        assertEquals( "Counter",
                      eflv1.getClassType() );
        assertEquals( DataType.TYPE_NUMERIC,
                      eflv1.getGenericType() );

        ExpressionField eflf1 = (ExpressionField) efl1.getParts().get( 1 );
        assertEquals( "number",
                      eflf1.getName() );
        assertEquals( "java.lang.Number",
View Full Code Here

        assertNotNull( fp2.getExpression() );
        ExpressionFormLine efl = fp2.getExpression();
        assertEquals( 3,
                      efl.getParts().size() );
        assertTrue( efl.getParts().get( 0 ) instanceof ExpressionVariable );
        ExpressionVariable ev = (ExpressionVariable) efl.getParts().get( 0 );
        assertEquals( "$trans",
                      ev.getName() );
        assertEquals( "Transactions",
                      ev.getClassType() );
        assertTrue( efl.getParts().get( 1 ) instanceof ExpressionMethod );
        ExpressionMethod em = (ExpressionMethod) efl.getParts().get( 1 );
        assertEquals( "getRecCategorization()",
                      em.getName() );
        assertEquals( "java.util.Map",
View Full Code Here

        assertNotNull( fp2.getExpression() );
        ExpressionFormLine efl = fp2.getExpression();
        assertEquals( 3,
                      efl.getParts().size() );
        assertTrue( efl.getParts().get( 0 ) instanceof ExpressionVariable );
        ExpressionVariable ev = (ExpressionVariable) efl.getParts().get( 0 );
        assertEquals( "$trans",
                      ev.getName() );
        assertEquals( "Transactions",
                      ev.getClassType() );
        assertTrue( efl.getParts().get( 1 ) instanceof ExpressionText );
        ExpressionText et1 = (ExpressionText) efl.getParts().get( 1 );
        assertEquals( "getRecCategorization()",
                      et1.getName() );
        assertEquals( "java.lang.String",
View Full Code Here

            ModelField[] fields = null;
            for ( int i = 0; i < splitSource.length; i++ ) {
                String sourcePart = splitSource[ i ];
                if ( i == 0 ) {
                    String type = boundParams.get( sourcePart );
                    expression.appendPart( new ExpressionVariable( sourcePart,
                                                                   type,
                                                                   DataType.TYPE_NUMERIC ) );
                    fields = findFields( m,
                                         dmo,
                                         type );
View Full Code Here

                                                                DataType.TYPE_THIS ) );

                } else if ( isBoundParam ) {
                    ModelField currentFact = findFact( dmo.getProjectModelFields(),
                                                       factType );
                    expression.appendPart( new ExpressionVariable( expressionPart,
                                                                   currentFact.getClassName(),
                                                                   currentFact.getType() ) );
                    isBoundParam = false;

                } else {
View Full Code Here

        final CompositeFactPattern cp = new CompositeFactPattern( CompositeFactPattern.COMPOSITE_TYPE_NOT );

        final FactPattern fp2 = new FactPattern( "Person" );
        final FromCompositeFactPattern ffp1 = new FromCompositeFactPattern();
        ffp1.setExpression( new ExpressionFormLine( new ExpressionVariable( fp1 ) ) );
        ffp1.setFactPattern( fp2 );
        cp.addFactPattern( ffp1 );
        m.addLhsItem( cp );

        final String actual = RuleModelDRLPersistenceImpl.getInstance().marshal( m );
View Full Code Here

            ModelField[] fields = null;
            for ( int i = 0; i < splitSource.length; i++ ) {
                String sourcePart = splitSource[ i ];
                if ( i == 0 ) {
                    String type = boundParams.get( sourcePart );
                    expression.appendPart( new ExpressionVariable( sourcePart, type, DataType.TYPE_NUMERIC ) );
                    fields = findFields( dmo, m, type );
                } else {
                    ModelField modelField = null;
                    for ( ModelField field : fields ) {
                        if ( field.getName().equals( sourcePart ) ) {
View Full Code Here

                                                                factType,
                                                                DataType.TYPE_THIS ) );
                } else if ( isBoundParam ) {
                    ModelField currentFact = findFact( dmo.getProjectModelFields(),
                                                       factType );
                    expression.appendPart( new ExpressionVariable( expressionPart,
                                                                   currentFact.getClassName(),
                                                                   currentFact.getType() ) );
                    isBoundParam = false;
                } else {
                    ModelField currentField = findField( typeFields,
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.datamodel.rule.ExpressionVariable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.