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

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


        RuleModel m = new RuleModel();
        m.name = "test expressionsString1";

        FactPattern p = new FactPattern( "Person" );
        SingleFieldConstraintEBLeftSide con = new SingleFieldConstraintEBLeftSide();
        con.getExpressionLeftSide().appendPart( new ExpressionText( "field1" ) );
        con.setOperator( "==" );
        con.setValue( "goo" );
        con.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL );
        p.addConstraint( con );
View Full Code Here


                                                                 "java.lang.Object",
                                                                 DataType.TYPE_OBJECT );
            }
            if ( "first".equals( value ) ) {
                collectionIndex.putParam( "index",
                                          new ExpressionFormLine( new ExpressionText( "0" ) ) );
                expression.appendPart( collectionIndex );
            } else if ( "last".equals( value ) ) {
                ExpressionFormLine index = new ExpressionFormLine( expression );
                index.appendPart( new ExpressionMethod( "size",
                                                        "int",
                                                        DataType.TYPE_NUMERIC_INTEGER ) );
                index.appendPart( new ExpressionText( "-1" ) );

                collectionIndex.putParam( "index",
                                          index );
                expression.appendPart( collectionIndex );
            }
View Full Code Here

            if ( "size".equals( value ) ) {
                expression.appendPart( new ExpressionMethod( "size",
                                                             "int",
                                                             DataType.TYPE_NUMERIC_INTEGER ) );
            } else if ( "isEmpty".equals( value ) ) {
                expression.appendPart( new ExpressionText( ".size() == 0",
                                                           "",
                                                           DataType.TYPE_NUMERIC_INTEGER ) );
            }
            onChangeSelectionUpdateExpressionWidget( oldType );
View Full Code Here

        RuleModel m = new RuleModel();
        m.name = "test expressionsString1";

        FactPattern p = new FactPattern( "Person" );
        SingleFieldConstraintEBLeftSide con = new SingleFieldConstraintEBLeftSide();
        con.getExpressionLeftSide().appendPart( new ExpressionText( "field1" ) );
        con.setOperator( "==" );
        con.setValue( "goo" );
        con.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL );
        p.addConstraint( con );
View Full Code Here

        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",
                      et.getClassType() );
        assertEquals( DataType.TYPE_STRING,
                      et.getGenericType() );

        assertEquals( 0,
                      m.rhs.length );
    }
View Full Code Here

        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",
                      et1.getClassType() );
        assertEquals( DataType.TYPE_STRING,
                      et1.getGenericType() );
        assertTrue( efl.getParts().get( 2 ) instanceof ExpressionText );
        ExpressionText et2 = (ExpressionText) efl.getParts().get( 2 );
        assertEquals( "get(\"APES-01\")",
                      et2.getName() );
        assertEquals( "java.lang.String",
                      et2.getClassType() );
        assertEquals( DataType.TYPE_STRING,
                      et2.getGenericType() );

        assertEquals( 0,
                      m.rhs.length );
    }
View Full Code Here

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

        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",
                      et.getClassType() );
        assertEquals( DataType.TYPE_STRING,
                      et.getGenericType() );

        assertEquals( 0,
                      m.rhs.length );
    }
View Full Code Here

        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",
                      et1.getClassType() );
        assertEquals( DataType.TYPE_STRING,
                      et1.getGenericType() );
        assertTrue( efl.getParts().get( 2 ) instanceof ExpressionText );
        ExpressionText et2 = (ExpressionText) efl.getParts().get( 2 );
        assertEquals( "get(\"APES-01\")",
                      et2.getName() );
        assertEquals( "java.lang.String",
                      et2.getClassType() );
        assertEquals( DataType.TYPE_STRING,
                      et2.getGenericType() );

        assertEquals( 0,
                      m.rhs.length );
    }
View Full Code Here

                                         param );
                        }
                    }
                    expression.appendPart( em );
                } else {
                    expression.appendPart( new ExpressionText( expressionPart ) );
                }

            } else if ( "Collection".equals( currentField.getType() ) ) {
                expression.appendPart( new ExpressionCollection( expressionPart,
                                                                 currentField.getClassName(),
View Full Code Here

TOP

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

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.