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

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


        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",
                      em.getClassType() );
        assertEquals( DataType.TYPE_COLLECTION,
                      em.getGenericType() );
        assertTrue( efl.getParts().get( 2 ) instanceof ExpressionText );
        ExpressionText et = (ExpressionText) efl.getParts().get( 2 );
        assertEquals( "get(\"APES-01\")",
                      et.getName() );
        assertEquals( "java.lang.String",
View Full Code Here


        final ExpressionUnboundFact expPart0 = (ExpressionUnboundFact) exp.getExpressionLeftSide().getParts().get( 0 );
        assertEquals( "Number",
                      expPart0.getFact().getFactType() );

        assertTrue( exp.getExpressionLeftSide().getParts().get( 1 ) instanceof ExpressionMethod );
        final ExpressionMethod expPart1 = (ExpressionMethod) exp.getExpressionLeftSide().getParts().get( 1 );
        assertEquals( "intValue",
                      expPart1.getName() );
    }
View Full Code Here

        final ExpressionField expPart1 = (ExpressionField) exp.getExpressionLeftSide().getParts().get( 1 );
        assertEquals( "this",
                      expPart1.getName() );

        assertTrue( exp.getExpressionLeftSide().getParts().get( 2 ) instanceof ExpressionMethod );
        final ExpressionMethod expPart2 = (ExpressionMethod) exp.getExpressionLeftSide().getParts().get( 2 );
        assertEquals( "intValue",
                      expPart2.getName() );
    }
View Full Code Here

        final ExpressionUnboundFact expPart0 = (ExpressionUnboundFact) exp.getExpressionLeftSide().getParts().get( 0 );
        assertEquals( "Parent",
                      expPart0.getFact().getFactType() );

        assertTrue( exp.getExpressionLeftSide().getParts().get( 1 ) instanceof ExpressionMethod );
        final ExpressionMethod expPart1 = (ExpressionMethod) exp.getExpressionLeftSide().getParts().get( 1 );
        assertEquals( "methodToGetChild1",
                      expPart1.getName() );

        assertTrue( exp.getExpressionLeftSide().getParts().get( 2 ) instanceof ExpressionMethod );
        final ExpressionMethod expPart2 = (ExpressionMethod) exp.getExpressionLeftSide().getParts().get( 2 );
        assertEquals( "methodToGetChild2",
                      expPart2.getName() );

        assertTrue( exp.getExpressionLeftSide().getParts().get( 3 ) instanceof ExpressionField );
        final ExpressionField expPart3 = (ExpressionField) exp.getExpressionLeftSide().getParts().get( 3 );
        assertEquals( "field1",
                      expPart3.getName() );
View Full Code Here

                        final List<MethodInfo> mis = dmo.getProjectMethodInformation().get( previousClassName );
                        boolean isMethod = false;
                        if ( mis != null ) {
                            for ( MethodInfo mi : mis ) {
                                if ( mi.getName().equals( sourcePart ) ) {
                                    expression.appendPart( new ExpressionMethod( mi.getName(),
                                                                                 mi.getReturnClassType(),
                                                                                 mi.getGenericType(),
                                                                                 mi.getParametricReturnType() ) );
                                    isMethod = true;
                                    break;
View Full Code Here

        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",
                      em.getClassType() );
        assertEquals( DataType.TYPE_COLLECTION,
                      em.getGenericType() );
        assertTrue( efl.getParts().get( 2 ) instanceof ExpressionText );
        ExpressionText et = (ExpressionText) efl.getParts().get( 2 );
        assertEquals( "get(\"APES-01\")",
                      et.getName() );
        assertEquals( "java.lang.String",
View Full Code Here

                                            final ExpressionFormLine expression,
                                            final String expressionPart ) {
            if ( currentField == null ) {
                boolean isMethod = currentMethodInfo != null;
                if ( isMethod ) {
                    final ExpressionMethod em = new ExpressionMethod( currentMethodInfo.getName(),
                                                                      currentMethodInfo.getReturnClassType(),
                                                                      currentMethodInfo.getGenericType(),
                                                                      currentMethodInfo.getParametricReturnType() );
                    //Add applicable parameter values
                    final List<String> parameters = parseExpressionParameters( expressionPart );
                    for ( int index = 0; index < currentMethodInfo.getParams().size(); index++ ) {
                        final String paramDataType = currentMethodInfo.getParams().get( index );
                        final String paramValue = getParameterValue( paramDataType,
                                                                     parameters,
                                                                     index );
                        if ( paramValue != null ) {
                            final ExpressionFormLine param = new ExpressionFormLine( index );
                            param.appendPart( new ExpressionMethodParameter( paramValue,
                                                                             paramDataType,
                                                                             paramDataType ) );
                            em.putParam( paramDataType,
                                         param );
                        }
                    }
                    expression.appendPart( em );
                } else {
View Full Code Here

        con1.setConstraintValueType( SingleFieldConstraint.TYPE_PREDICATE );
        p.addConstraint( con1 );

        SingleFieldConstraintEBLeftSide con2 = new SingleFieldConstraintEBLeftSide();
        con2.getExpressionLeftSide().appendPart( new ExpressionUnboundFact( p ) );
        con2.getExpressionLeftSide().appendPart( new ExpressionMethod( "intValue",
                                                                       "int",
                                                                       DataType.TYPE_NUMERIC_INTEGER ) );
        con2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        con2.setOperator( "==" );
        con2.setValue( "0" );
View Full Code Here

        con1.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL );
        p.addConstraint( con1 );

        SingleFieldConstraintEBLeftSide con2 = new SingleFieldConstraintEBLeftSide();
        con2.getExpressionLeftSide().appendPart( new ExpressionUnboundFact( p ) );
        con2.getExpressionLeftSide().appendPart( new ExpressionMethod( "intValue",
                                                                       "int",
                                                                       DataType.TYPE_NUMERIC_INTEGER ) );
        con2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        con2.setOperator( "==" );
        con2.setValue( "0" );
View Full Code Here

                        final List<MethodInfo> mis = dmo.getProjectMethodInformation().get( previousClassName );
                        boolean isMethod = false;
                        if ( mis != null ) {
                            for ( MethodInfo mi : mis ) {
                                if ( mi.getName().equals( sourcePart ) ) {
                                    expression.appendPart( new ExpressionMethod( mi.getName(),
                                                                                 mi.getReturnClassType(),
                                                                                 mi.getGenericType(),
                                                                                 mi.getParametricReturnType() ) );
                                    isMethod = true;
                                    break;
View Full Code Here

TOP

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

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.