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

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


            public void onClick( ClickEvent event ) {
                Widget sender = (Widget) event.getSource();
                if ( sender == fromBtn ) {
                    getFromAccumulatePattern().setSourcePattern( new FromCompositeFactPattern() );
                } else if ( sender == fromAccumulateBtn ) {
                    getFromAccumulatePattern().setSourcePattern( new FromAccumulateCompositeFactPattern() );
                } else if ( sender == fromCollectBtn ) {
                    getFromAccumulatePattern().setSourcePattern( new FromCollectCompositeFactPattern() );
                } else if ( sender == fromEntryPointBtn ) {
                    getFromAccumulatePattern().setSourcePattern( new FromEntryPointFactPattern() );
                } else {
View Full Code Here


        SingleFieldConstraint constraint2 = new SingleFieldConstraint( "street" );
        constraint2.setOperator( "!=" );
        constraint2.setValue( "some street" );
        pattern2.addConstraint( constraint2 );

        FromAccumulateCompositeFactPattern fromAccumulateCompositeFactPattern = new FromAccumulateCompositeFactPattern();
        fromAccumulateCompositeFactPattern.setSourcePattern( pattern1 );
        fromAccumulateCompositeFactPattern.setFactPattern( pattern2 );
        ExpressionFormLine expression = new ExpressionFormLine();
        expression.setBinding( "person.addresses" );
        fromAccumulateCompositeFactPattern.setExpression( expression );

        model.lhs = new IPattern[]{ fromAccumulateCompositeFactPattern };

        assertTrue( validator.isValid() );
    }
View Full Code Here

        FactPattern pattern2 = new FactPattern( "Address" );
        SingleFieldConstraint constraint2 = new SingleFieldConstraint( "street" );
        constraint2.setOperator( "!=" );
        pattern2.addConstraint( constraint2 );

        FromAccumulateCompositeFactPattern fromAccumulateCompositeFactPattern = new FromAccumulateCompositeFactPattern();
        fromAccumulateCompositeFactPattern.setSourcePattern( pattern1 );
        fromAccumulateCompositeFactPattern.setFactPattern( pattern2 );
        fromAccumulateCompositeFactPattern.setFunction( "test()" );

        model.lhs = new IPattern[]{ fromAccumulateCompositeFactPattern };

        assertFalse( validator.isValid() );
        assertEquals( 2, validator.getErrors().size() );
View Full Code Here

    public void testFromAccumulateCompositePatternMissingValues2() throws Exception {
        FactPattern pattern1 = new FactPattern( "Person" );

        FactPattern pattern2 = new FactPattern( "Address" );

        FromAccumulateCompositeFactPattern fromAccumulateCompositeFactPattern = new FromAccumulateCompositeFactPattern();
        fromAccumulateCompositeFactPattern.setSourcePattern( pattern1 );
        fromAccumulateCompositeFactPattern.setFactPattern( pattern2 );
        fromAccumulateCompositeFactPattern.setFunction( "" );
        fromAccumulateCompositeFactPattern.setReverseCode( "" );
        fromAccumulateCompositeFactPattern.setInitCode( "" );
        fromAccumulateCompositeFactPattern.setActionCode( "" );
        fromAccumulateCompositeFactPattern.setResultCode( "" );

        model.lhs = new IPattern[]{ fromAccumulateCompositeFactPattern };

        assertFalse( validator.isValid() );
        assertEquals( 1, validator.getErrors().size() );
View Full Code Here

        FactPattern pattern2 = new FactPattern( "Address" );
        SingleFieldConstraint constraint2 = new SingleFieldConstraint( "street" );
        constraint2.setOperator( "!=" );
        pattern2.addConstraint( constraint2 );

        FromAccumulateCompositeFactPattern fromAccumulateCompositeFactPattern = new FromAccumulateCompositeFactPattern();
        fromAccumulateCompositeFactPattern.setSourcePattern( pattern1 );
        fromAccumulateCompositeFactPattern.setFactPattern( pattern2 );
        fromAccumulateCompositeFactPattern.setInitCode( "int i = 0" );
        fromAccumulateCompositeFactPattern.setActionCode( " i++;" );
        fromAccumulateCompositeFactPattern.setReverseCode( "i--;" );
        fromAccumulateCompositeFactPattern.setResultCode( "return i" );

        model.lhs = new IPattern[]{ fromAccumulateCompositeFactPattern };

        assertFalse( validator.isValid() );
        assertEquals( 2, validator.getErrors().size() );
View Full Code Here

TOP

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

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.