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

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


                                                                           dmo );
        assertTrue( m.lhs[ 1 ] instanceof FromCompositeFactPattern );
        FromCompositeFactPattern factPattern = (FromCompositeFactPattern) m.lhs[ 1 ];
        assertNotNull( factPattern.getFactPattern().getConstraintList() );
        assertEquals( 1, factPattern.getFactPattern().getConstraintList().getNumberOfConstraints() );
        SingleFieldConstraint constraint = (SingleFieldConstraint) factPattern.getFactPattern().getFieldConstraints()[ 0 ];
        assertEquals( "Itinerario", constraint.getFactType() );
        assertEquals( "destino", constraint.getFieldName() );
        assertEquals( DataType.TYPE_STRING, constraint.getFieldType() );
        assertEquals( "USA", constraint.getValue() );
        assertEquals( "==", constraint.getOperator() );
    }
View Full Code Here


        assertEquals( "total", factPattern.getBoundName() );
        assertNotNull( factPattern.getConstraintList() );
        assertEquals( 1, factPattern.getConstraintList().getNumberOfConstraints() );
        FieldConstraint constraint = factPattern.getConstraintList().getConstraint( 0 );
        assertTrue( constraint instanceof SingleFieldConstraint );
        SingleFieldConstraint fieldConstraint = (SingleFieldConstraint) constraint;
        assertEquals( "Number", fieldConstraint.getFactType() );
        assertEquals( "intValue", fieldConstraint.getFieldName() );
        assertEquals( "Integer", fieldConstraint.getFieldType() );
        assertEquals( ">", fieldConstraint.getOperator() );
        assertEquals( "0", fieldConstraint.getValue() );
    }
View Full Code Here

        assertEquals( 1,
                      fp.getConstraintList().getConstraints().length );
        assertTrue( fp.getConstraint( 0 ) instanceof SingleFieldConstraint );

        SingleFieldConstraint sfp = (SingleFieldConstraint) fp.getConstraint( 0 );
        assertEquals( "Person",
                      sfp.getFactType() );
        assertEquals( "field1",
                      sfp.getFieldName() );
        assertEquals( "==",
                      sfp.getOperator() );
        assertEquals( "44",
                      sfp.getValue() );
        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      sfp.getConstraintValueType() );
        assertEquals( "$f",
                      sfp.getFieldBinding() );

        assertEquals( 1,
                      m.rhs.length );
        IAction a = m.rhs[ 0 ];
        assertTrue( a instanceof ActionInsertFact );
View Full Code Here

        assertEquals( 1,
                      fp.getConstraintList().getConstraints().length );
        assertTrue( fp.getConstraint( 0 ) instanceof SingleFieldConstraint );

        SingleFieldConstraint sfp = (SingleFieldConstraint) fp.getConstraint( 0 );
        assertEquals( "Person",
                      sfp.getFactType() );
        assertEquals( "field1",
                      sfp.getFieldName() );
        assertEquals( "==",
                      sfp.getOperator() );
        assertEquals( "44",
                      sfp.getValue() );
        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      sfp.getConstraintValueType() );

        assertEquals( 1,
                      m.rhs.length );
        IAction a = m.rhs[ 0 ];
        assertTrue( a instanceof ActionInsertFact );
View Full Code Here

        assertEquals( 1,
                      fp.getConstraintList().getConstraints().length );
        assertTrue( fp.getConstraint( 0 ) instanceof SingleFieldConstraint );

        SingleFieldConstraint sfp = (SingleFieldConstraint) fp.getConstraint( 0 );
        assertEquals( "Person",
                      sfp.getFactType() );
        assertEquals( "field1",
                      sfp.getFieldName() );
        assertEquals( "==",
                      sfp.getOperator() );
        assertEquals( "44",
                      sfp.getValue() );
        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      sfp.getConstraintValueType() );
        assertEquals( "$f",
                      sfp.getFieldBinding() );

        assertEquals( 1,
                      m.rhs.length );
        IAction a = m.rhs[ 0 ];
        assertTrue( a instanceof ActionUpdateField );
View Full Code Here

        assertEquals( 1,
                      fp.getConstraintList().getConstraints().length );
        assertTrue( fp.getConstraint( 0 ) instanceof SingleFieldConstraint );

        SingleFieldConstraint sfp = (SingleFieldConstraint) fp.getConstraint( 0 );
        assertEquals( "Person",
                      sfp.getFactType() );
        assertEquals( "field1",
                      sfp.getFieldName() );
        assertEquals( "==",
                      sfp.getOperator() );
        assertEquals( "44",
                      sfp.getValue() );
        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      sfp.getConstraintValueType() );
        assertEquals( "$f",
                      sfp.getFieldBinding() );

        assertEquals( 1,
                      m.rhs.length );
        IAction a = m.rhs[ 0 ];
        assertTrue( a instanceof ActionInsertFact );
View Full Code Here

        assertEquals( 1,
                      fp.getConstraintList().getConstraints().length );
        assertTrue( fp.getConstraint( 0 ) instanceof SingleFieldConstraint );

        SingleFieldConstraint sfp = (SingleFieldConstraint) fp.getConstraint( 0 );
        assertEquals( "Person",
                      sfp.getFactType() );
        assertEquals( "field1",
                      sfp.getFieldName() );
        assertEquals( "==",
                      sfp.getOperator() );
        assertEquals( "44",
                      sfp.getValue() );
        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      sfp.getConstraintValueType() );

        assertEquals( 1,
                      m.rhs.length );
        IAction a = m.rhs[ 0 ];
        assertTrue( a instanceof ActionInsertFact );
View Full Code Here

        assertEquals( 1,
                      fp.getConstraintList().getConstraints().length );
        assertTrue( fp.getConstraint( 0 ) instanceof SingleFieldConstraint );

        SingleFieldConstraint sfp = (SingleFieldConstraint) fp.getConstraint( 0 );
        assertEquals( "Person",
                      sfp.getFactType() );
        assertEquals( "field1",
                      sfp.getFieldName() );
        assertEquals( "==",
                      sfp.getOperator() );
        assertEquals( "44",
                      sfp.getValue() );
        assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
                      sfp.getConstraintValueType() );
        assertEquals( "$f",
                      sfp.getFieldBinding() );

        assertEquals( 1,
                      m.rhs.length );
        IAction a = m.rhs[ 0 ];
        assertTrue( a instanceof ActionUpdateField );
View Full Code Here

        assertEquals( "$transactions",
                      fp1.getFactPattern().getBoundName() );
        assertEquals( 1,
                      fp1.getFactPattern().getNumberOfConstraints() );
        assertTrue( fp1.getFactPattern().getConstraint( 0 ) instanceof SingleFieldConstraint );
        SingleFieldConstraint fp1sfc = (SingleFieldConstraint) fp1.getFactPattern().getConstraint( 0 );
        assertEquals( "size > 0",
                      fp1sfc.getValue() );
        assertEquals( BaseSingleFieldConstraint.TYPE_PREDICATE,
                      fp1sfc.getConstraintValueType() );

        assertTrue( fp1.getRightPattern() instanceof FromCompositeFactPattern );
        FromCompositeFactPattern fp2 = (FromCompositeFactPattern) fp1.getRightPattern();
        assertNotNull( fp2.getFactPattern() );
View Full Code Here

        assertEquals( "$transactions",
                      fp1.getFactPattern().getBoundName() );
        assertEquals( 1,
                      fp1.getFactPattern().getNumberOfConstraints() );
        assertTrue( fp1.getFactPattern().getConstraint( 0 ) instanceof SingleFieldConstraint );
        SingleFieldConstraint fp1sfc = (SingleFieldConstraint) fp1.getFactPattern().getConstraint( 0 );
        assertEquals( "size > 0",
                      fp1sfc.getValue() );
        assertEquals( BaseSingleFieldConstraint.TYPE_PREDICATE,
                      fp1sfc.getConstraintValueType() );

        assertTrue( fp1.getRightPattern() instanceof FromCompositeFactPattern );
        FromCompositeFactPattern fp2 = (FromCompositeFactPattern) fp1.getRightPattern();
        assertNotNull( fp2.getFactPattern() );
View Full Code Here

TOP

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

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.