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

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


        sfc2.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
        sfc2.setOperator( ">" );
        sfc2.setValue( "$f2" );
        fp2.addConstraint( sfc2 );

        FromCollectCompositeFactPattern fac = new FromCollectCompositeFactPattern();
        fac.setRightPattern( fp );
        fac.setFactPattern( fp2 );
        m.addLhsItem( fac );

        String expected = "rule \"r1_0\"\n"
                + "dialect \"mvel\"\n"
                + "when\n"
View Full Code Here


        sfc2.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
        sfc2.setOperator( ">" );
        sfc2.setValue( "$f2" );
        fp2.addConstraint( sfc2 );

        FromCollectCompositeFactPattern fac = new FromCollectCompositeFactPattern();
        fac.setRightPattern( fp );
        fac.setFactPattern( fp2 );
        m.addLhsItem( fac );

        String expected = "rule \"r1_0\"\n"
                + "dialect \"mvel\"\n"
                + "when\n"
View Full Code Here

        sfc2.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
        sfc2.setOperator( ">" );
        sfc2.setValue( "$f2" );
        fp2.addConstraint( sfc2 );

        FromCollectCompositeFactPattern fac = new FromCollectCompositeFactPattern();
        fac.setRightPattern( fp );
        fac.setFactPattern( fp2 );
        m.addLhsItem( fac );

        String expected = "rule \"r1_0\"\n"
                + "dialect \"mvel\"\n"
                + "when\n"
View Full Code Here

        FreeFormLine ffl = new FreeFormLine();
        ffl.setText( "Person( field1 == \"@{f1}\", field2 == \"@{f2}\" )" );

        FactPattern fp = new FactPattern( "java.util.List" );

        FromCollectCompositeFactPattern fac = new FromCollectCompositeFactPattern();
        fac.setRightPattern( ffl );
        fac.setFactPattern( fp );
        m.addLhsItem( fac );

        String expected = "rule \"r1_0\"\n"
                + "dialect \"mvel\"\n"
                + "when\n"
View Full Code Here

        FreeFormLine ffl = new FreeFormLine();
        ffl.setText( "Person( field1 == \"@{f1}\", field2 == \"@{f2}\" )" );

        FactPattern fp = new FactPattern( "java.util.List" );

        FromCollectCompositeFactPattern fac = new FromCollectCompositeFactPattern();
        fac.setRightPattern( ffl );
        fac.setFactPattern( fp );
        m.addLhsItem( fac );

        String expected = "rule \"r1_0\"\n"
                + "dialect \"mvel\"\n"
                + "when\n"
View Full Code Here

        FreeFormLine ffl = new FreeFormLine();
        ffl.setText( "Person( field1 == \"@{f1}\", field2 == \"@{f2}\" )" );

        FactPattern fp = new FactPattern( "java.util.List" );

        FromCollectCompositeFactPattern fac = new FromCollectCompositeFactPattern();
        fac.setRightPattern( ffl );
        fac.setFactPattern( fp );
        m.addLhsItem( fac );

        String expected = "rule \"r1_0\"\n"
                + "dialect \"mvel\"\n"
                + "when\n"
View Full Code Here

        sfc2.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
        sfc2.setOperator( ">" );
        sfc2.setValue( "$f3" );
        fp2.addConstraint( sfc2 );

        FromCollectCompositeFactPattern fac = new FromCollectCompositeFactPattern();
        fac.setRightPattern( fp );
        fac.setFactPattern( fp2 );
        m.addLhsItem( fac );

        String expected = "rule \"r1_0\"\n"
                + "dialect \"mvel\"\n"
                + "when\n"
View Full Code Here

        sfc2.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
        sfc2.setOperator( ">" );
        sfc2.setValue( "$f3" );
        fp2.addConstraint( sfc2 );

        FromCollectCompositeFactPattern fac = new FromCollectCompositeFactPattern();
        fac.setRightPattern( fp );
        fac.setFactPattern( fp2 );
        m.addLhsItem( fac );

        String expected = "rule \"r1_0\"\n"
                + "dialect \"mvel\"\n"
                + "when\n"
View Full Code Here

        sfc2.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
        sfc2.setOperator( ">" );
        sfc2.setValue( "$f3" );
        fp2.addConstraint( sfc2 );

        FromCollectCompositeFactPattern fac = new FromCollectCompositeFactPattern();
        fac.setRightPattern( fp );
        fac.setFactPattern( fp2 );
        m.addLhsItem( fac );

        String expected = "rule \"r1_0\"\n"
                + "dialect \"mvel\"\n"
                + "when\n"
View Full Code Here

        assertEquals( 0,
                      fp0.getNumberOfConstraints() );

        IPattern p1 = m.lhs[ 1 ];
        assertTrue( p1 instanceof FromCollectCompositeFactPattern );
        FromCollectCompositeFactPattern fp1 = (FromCollectCompositeFactPattern) p1;
        assertEquals( "java.util.List",
                      fp1.getFactPattern().getFactType() );
        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() );

        FactPattern fp3 = fp2.getFactPattern();
        assertEquals( "Transaction",
                      fp3.getFactType() );
View Full Code Here

TOP

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

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.