Package org.drools.verifier.components

Examples of org.drools.verifier.components.Pattern


        session.setAgendaFilter( new RuleNameMatchesAgendaFilter( "Opposite LiteralRestrictions with ranges, greater - less or equal" ) );

        Collection<Object> data = new ArrayList<Object>();

        Pattern pattern = VerifierComponentMockFactory.createPattern1();
        LiteralRestriction r1 = LiteralRestriction.createRestriction( pattern,
                                                                      "1" );
        r1.setFieldPath( "0" );
        r1.setOperator( Operator.GREATER );
        r1.setOrderNumber( 0 );
View Full Code Here


        session.setAgendaFilter( new RuleNameMatchesAgendaFilter( "Opposite LiteralRestrictions with ranges, less or equal - greater or equal for ints and dates" ) );

        Collection<Object> data = new ArrayList<Object>();

        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        LiteralRestriction r1 = LiteralRestriction.createRestriction( pattern,
                                                                      "1" );
        r1.setFieldPath( "0" );
        r1.setOperator( Operator.GREATER_OR_EQUAL );
View Full Code Here

        Collection<Object> data = new ArrayList<Object>();

        VerifierRule rule = VerifierComponentMockFactory.createRule1();

        Pattern pattern1 = VerifierComponentMockFactory.createPattern( 1 );
        Pattern pattern2 = VerifierComponentMockFactory.createPattern( 2 );
        Pattern pattern3 = VerifierComponentMockFactory.createPattern( 3 );

        /*
         * Working pair
         */
        Variable variable1 = new Variable( rule );
View Full Code Here

        session.setGlobal( "result",
                           result );

        // This pattern has an error.
        Pattern pattern1 = VerifierComponentMockFactory.createPattern1();

        Restriction r1 = LiteralRestriction.createRestriction( pattern1,
                                                               "" );
        Restriction r2 = LiteralRestriction.createRestriction( pattern1,
                                                               "" );
        Incompatibility i1 = new Incompatibility( r1,
                                                  r2 );
        SubPattern pp1 = new SubPattern( pattern1,
                                         0 );
        pp1.add( r1 );
        pp1.add( r2 );

        Restriction r3 = new VariableRestriction( pattern1 );
        Restriction r4 = new VariableRestriction( pattern1 );
        Incompatibility i2 = new Incompatibility( r1,
                                                  r2 );
        SubPattern pp2 = new SubPattern( pattern1,
                                         1 );
        pp2.add( r1 );
        pp2.add( r2 );

        // This pattern does not have an error.
        Pattern pattern2 = VerifierComponentMockFactory.createPattern2();

        Restriction r5 = LiteralRestriction.createRestriction( pattern2,
                                                               "" );
        Restriction r6 = LiteralRestriction.createRestriction( pattern2,
                                                               "" );
View Full Code Here

        session.setGlobal( "result",
                           result );

        // This pattern has an error.
        VerifierRule rule1 = VerifierComponentMockFactory.createRule1();
        Pattern pattern1 = VerifierComponentMockFactory.createPattern1();

        data.add( rule1 );
        data.add( pattern1 );

        session.executeWithResults( data );
View Full Code Here

        session.setGlobal( "result",
                           result );

        // This rule has an error.
        VerifierRule rule1 = VerifierComponentMockFactory.createRule1();
        Pattern pattern1 = VerifierComponentMockFactory.createPattern1();

        SubPattern pp1 = new SubPattern( pattern1,
                                         0 );
        SubPattern pp2 = new SubPattern( pattern1,
                                         1 );
        Incompatibility i1 = new Incompatibility( pp1,
                                                  pp2 );
        SubRule rp1 = new SubRule( rule1,
                                   0 );
        rp1.add( pp1 );
        rp1.add( pp2 );

        SubPattern pp3 = new SubPattern( pattern1,
                                         2 );
        SubPattern pp4 = new SubPattern( pattern1,
                                         3 );
        Incompatibility i2 = new Incompatibility( pp1,
                                                  pp2 );
        SubRule rp2 = new SubRule( rule1,
                                   1 );
        rp2.add( pp1 );
        rp2.add( pp2 );

        // This pattern does not have an error.
        VerifierRule rule2 = VerifierComponentMockFactory.createRule2();
        Pattern pattern2 = VerifierComponentMockFactory.createPattern2();

        SubPattern pp5 = new SubPattern( pattern2,
                                         0 );
        SubPattern pp6 = new SubPattern( pattern2,
                                         1 );
View Full Code Here

     * result:<br>
     * descr && descr2
     */
    @Test
    public void testAddBasicAnd() {
        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        LiteralRestriction literalRestriction = LiteralRestriction.createRestriction( pattern,
                                                                                      "" );
        LiteralRestriction literalRestriction2 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
View Full Code Here

     * or<br>
     * descr2
     */
    @Test
    public void testAddBasicOr() {
        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        LiteralRestriction literalRestriction = LiteralRestriction.createRestriction( pattern,
                                                                                      "" );
        LiteralRestriction literalRestriction2 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
View Full Code Here

     * or<br>
     * descr2 && descr3
     */
    @Test
    public void testAddOrAnd() {
        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        LiteralRestriction literalRestriction = LiteralRestriction.createRestriction( pattern,
                                                                                      "" );
        LiteralRestriction literalRestriction2 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
View Full Code Here

     * or<br>
     * descr && descr3
     */
    @Test
    public void testAddAndOr() {
        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        LiteralRestriction literalRestriction = LiteralRestriction.createRestriction( pattern,
                                                                                      "" );
        LiteralRestriction literalRestriction2 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );
View Full Code Here

TOP

Related Classes of org.drools.verifier.components.Pattern

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.