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

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


                break;
            }
            return fac;
        } else if ( patternSource instanceof CollectDescr ) {
            CollectDescr collect = (CollectDescr) patternSource;
            FromCollectCompositeFactPattern fac = new FromCollectCompositeFactPattern();
            fac.setRightPattern( parseBaseDescr( collect.getInputPattern(), boundParams, dmo ) );
            fac.setFactPattern( new FactPattern( pattern.getObjectType() ) );
            return fac;
        } else if ( patternSource instanceof EntryPointDescr ) {
            EntryPointDescr entryPoint = (EntryPointDescr) patternSource;
            FromEntryPointFactPattern fep = new FromEntryPointFactPattern();
            fep.setEntryPointName( entryPoint.getText() );
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

        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

        fp.addConstraint( sfc );

        FromEntryPointFactPattern fep = new FromEntryPointFactPattern();
        fep.setEntryPointName( "ep" );
        fep.setFactPattern( fp );
        FromCollectCompositeFactPattern fac = new FromCollectCompositeFactPattern();
        fac.setRightPattern( fep );
        fac.setFactPattern( new FactPattern( "java.util.List" ) );
        m.addLhsItem( fac );

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

        fp.addConstraint( sfc );

        FromEntryPointFactPattern fep = new FromEntryPointFactPattern();
        fep.setEntryPointName( "ep" );
        fep.setFactPattern( fp );
        FromCollectCompositeFactPattern fac = new FromCollectCompositeFactPattern();
        fac.setRightPattern( fep );
        fac.setFactPattern( new FactPattern( "java.util.List" ) );
        m.addLhsItem( fac );

        String expected = "rule \"r1\"\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

        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

                break;
            }
            return fac;
        } else if ( patternSource instanceof CollectDescr ) {
            CollectDescr collect = (CollectDescr) patternSource;
            FromCollectCompositeFactPattern fac = new FromCollectCompositeFactPattern();
            fac.setRightPattern( parseBaseDescr( m,
                                                 collect.getInputPattern(),
                                                 isJavaDialect,
                                                 boundParams,
                                                 dmo ) );
            fac.setFactPattern( getFactPattern( m,
                                                pattern,
                                                isJavaDialect,
                                                boundParams,
                                                dmo ) );
            return fac;
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

        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.