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

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


                        if ( field.getName().equals( sourcePart ) ) {
                            modelField = field;
                            break;
                        }
                    }
                    expression.appendPart( new ExpressionField( sourcePart, modelField.getClassName(), modelField.getType() ) );
                    fields = findFields( dmo, m, modelField.getClassName() );
                }
            }

            return fcfp;
View Full Code Here


            ModelField[] typeFields = findFields( m, factType );

            for ( int i = 0; i < splits.length - 1; i++ ) {
                String expressionPart = normalizeExpressionPart( splits[ i ] );
                if ( "this".equals( expressionPart ) ) {
                    expression.appendPart( new ExpressionField( expressionPart,
                                                                getSimpleFactType( factType,
                                                                                   dmo ),
                                                                DataType.TYPE_THIS ) );
                } else if ( isBoundParam ) {
                    ModelField currentFact = findFact( dmo.getProjectModelFields(),
                                                       factType );
                    expression.appendPart( new ExpressionVariable( expressionPart,
                                                                   getSimpleFactType( currentFact.getClassName(),
                                                                                      dmo ),
                                                                   getSimpleFactType( currentFact.getType(),
                                                                                      dmo ) ) );
                    isBoundParam = false;
                } else {
                    ModelField currentField = findField( typeFields,
                                                         expressionPart );
                    expression.appendPart( new ExpressionField( expressionPart,
                                                                getSimpleFactType( currentField.getClassName(),
                                                                                   dmo ),
                                                                getSimpleFactType( currentField.getType(),
                                                                                   dmo ) ) );
                    typeFields = findFields( m, currentField.getClassName() );
                }
            }
            String expressionPart = normalizeExpressionPart( splits[ splits.length - 1 ] );
            ModelField currentField = findField( typeFields,
                                                 expressionPart );
            expression.appendPart( new ExpressionField( expressionPart,
                                                        getSimpleFactType( currentField.getClassName(),
                                                                           dmo ),
                                                        getSimpleFactType( currentField.getType(),
                                                                           dmo ) ) );
            return expression;
View Full Code Here

                        }
                        if ( isMethod == false ) {
                            expression.appendPart( new ExpressionText( sourcePart ) );
                        }
                    } else {
                        expression.appendPart( new ExpressionField( sourcePart,
                                                                    modelField.getClassName(),
                                                                    modelField.getType() ) );
                        fields = findFields( dmo,
                                             m,
                                             modelField.getClassName() );
View Full Code Here

            ModelField[] typeFields = modelFields.get( factType );

            for ( int i = 0; i < splits.length - 1; i++ ) {
                String expressionPart = normalizeExpressionPart( splits[ i ] );
                if ( "this".equals( expressionPart ) ) {
                    expression.appendPart( new ExpressionField( expressionPart,
                                                                getSimpleFactType( factType,
                                                                                   dmo ),
                                                                DataType.TYPE_THIS ) );
                } else if ( isBoundParam ) {
                    ModelField currentFact = findFact( modelFields,
                                                       factType );
                    expression.appendPart( new ExpressionVariable( expressionPart,
                                                                   getSimpleFactType( currentFact.getClassName(),
                                                                                      dmo ),
                                                                   getSimpleFactType( currentFact.getType(),
                                                                                      dmo ) ) );
                    isBoundParam = false;
                } else {
                    ModelField currentField = findField( typeFields,
                                                         expressionPart );
                    expression.appendPart( new ExpressionField( expressionPart,
                                                                getSimpleFactType( currentField.getClassName(),
                                                                                   dmo ),
                                                                getSimpleFactType( currentField.getType(),
                                                                                   dmo ) ) );
                    typeFields = modelFields.get( currentField.getClassName() );
                }
            }
            String expressionPart = normalizeExpressionPart( splits[ splits.length - 1 ] );
            ModelField currentField = findField( typeFields,
                                                 expressionPart );
            expression.appendPart( new ExpressionField( expressionPart,
                                                        getSimpleFactType( currentField.getClassName(),
                                                                           dmo ),
                                                        getSimpleFactType( currentField.getType(),
                                                                           dmo ) ) );
            return expression;
View Full Code Here

                        }
                        if ( isMethod == false ) {
                            expression.appendPart( new ExpressionText( sourcePart ) );
                        }
                    } else {
                        expression.appendPart( new ExpressionField( sourcePart,
                                                                    modelField.getClassName(),
                                                                    modelField.getType() ) );
                        fields = findFields( m,
                                             dmo,
                                             modelField.getClassName() );
View Full Code Here

                    methodInfos = getMethodInfosForType( m,
                                                         dmo,
                                                         factType );
                }
                if ( "this".equals( expressionPart ) ) {
                    expression.appendPart( new ExpressionField( expressionPart,
                                                                factType,
                                                                DataType.TYPE_THIS ) );

                } else if ( isBoundParam ) {
                    ModelField currentFact = findFact( dmo.getProjectModelFields(),
View Full Code Here

                                                                 currentField.getClassName(),
                                                                 currentField.getType(),
                                                                 dmo.getProjectFieldParametersType().get( factType + "#" + expressionPart ) )
                                     );
            } else {
                expression.appendPart( new ExpressionField( expressionPart,
                                                            currentField.getClassName(),
                                                            currentField.getType() ) );
            }

        }
View Full Code Here

                    methodInfos = getMethodInfosForType( m,
                                                         dmo,
                                                         factType );
                }
                if ( "this".equals( expressionPart ) ) {
                    expression.appendPart( new ExpressionField( expressionPart,
                                                                factType,
                                                                DataType.TYPE_THIS ) );

                } else if ( isBoundParam ) {
                    ModelField currentFact = findFact( dmo.getProjectModelFields(),
View Full Code Here

                                                                 currentField.getClassName(),
                                                                 currentField.getType(),
                                                                 dmo.getProjectFieldParametersType().get( factType + "#" + expressionPart ) )
                                     );
            } else {
                expression.appendPart( new ExpressionField( expressionPart,
                                                            currentField.getClassName(),
                                                            currentField.getType() ) );
            }

        }
View Full Code Here

        assertEquals( null, expressionUnboundFact.getPrevious() );
        assertEquals( ebLeftSide.getExpressionLeftSide().getParts().get( 1 ),
                      expressionUnboundFact.getNext() );

        assertTrue( ebLeftSide.getExpressionLeftSide().getParts().get( 1 ) instanceof ExpressionField );
        ExpressionField expressionField1 = (ExpressionField) ebLeftSide.getExpressionLeftSide().getParts().get( 1 );
        assertEquals( "contact",
                      expressionField1.getName() );
        assertEquals( "org.test.Contact",
                      expressionField1.getClassType() );
        assertEquals( "Contact",
                      expressionField1.getGenericType() );

        assertEquals( ebLeftSide.getExpressionLeftSide().getParts().get( 0 ),
                      expressionField1.getPrevious() );
        assertEquals( ebLeftSide.getExpressionLeftSide().getParts().get( 2 ),
                      expressionField1.getNext() );

        assertTrue( ebLeftSide.getExpressionLeftSide().getParts().get( 2 ) instanceof ExpressionField );
        ExpressionField expressionField2 = (ExpressionField) ebLeftSide.getExpressionLeftSide().getParts().get( 2 );
        assertEquals( "telephone",
                      expressionField2.getName() );
        assertEquals( "java.lang.Integer",
                      expressionField2.getClassType() );
        assertEquals( DataType.TYPE_NUMERIC_INTEGER,
                      expressionField2.getGenericType() );

        assertEquals( ebLeftSide.getExpressionLeftSide().getParts().get( 1 ),
                      expressionField2.getPrevious() );
        assertNull( expressionField2.getNext() );
    }
View Full Code Here

TOP

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

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.