Examples of ExpressionField


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

            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

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

                        }
                        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

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

                    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

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

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

        }
View Full Code Here

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

                    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

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

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

        }
View Full Code Here

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

        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

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

        assertNull( 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( "parentChildField",
                      expressionField1.getName() );
        assertEquals( "org.test.ChildType",
                      expressionField1.getClassType() );
        assertEquals( "ChildType",
                      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( "childField",
                      expressionField2.getName() );
        assertEquals( "java.lang.String",
                      expressionField2.getClassType() );
        assertEquals( "String",
                      expressionField2.getGenericType() );

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

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

        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() );
        assertEquals( "Integer", expressionField.getGenericType() );
    }
View Full Code Here

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

                      eubf.getClassType() );
        assertEquals( "OuterClassWithEnums",
                      eubf.getGenericType() );

        assertTrue( constraint.getExpressionLeftSide().getParts().get( 1 ) instanceof ExpressionField );
        final ExpressionField ef1 = ( (ExpressionField) constraint.getExpressionLeftSide().getParts().get( 1 ) );
        assertEquals( "innerClass",
                      ef1.getName() );
        assertEquals( "InnerClassWithEnums",
                      ef1.getClassType() );
        assertEquals( "InnerClassWithEnums",
                      ef1.getGenericType() );

        assertTrue( constraint.getExpressionLeftSide().getParts().get( 2 ) instanceof ExpressionField );
        final ExpressionField ef2 = ( (ExpressionField) constraint.getExpressionLeftSide().getParts().get( 2 ) );
        assertEquals( "innerField",
                      ef2.getName() );
        assertEquals( "TestEnum",
                      ef2.getClassType() );
        assertEquals( DataType.TYPE_COMPARABLE,
                      ef2.getGenericType() );

        assertEquals( "OuterClassWithEnums",
                      constraint.getFactType() );
        assertEquals( "innerField",
                      constraint.getFieldName() );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.