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

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


                         boundParams,
                         dmo );

        for ( BehaviorDescr behavior : pattern.getBehaviors() ) {
            if ( behavior.getText().equals( "window" ) ) {
                CEPWindow window = new CEPWindow();
                window.setOperator( "over window:" + behavior.getSubType() );
                window.setParameter( "org.drools.workbench.models.commons.backend.rule.operatorParameterGenerator",
                                     "org.drools.workbench.models.commons.backend.rule.CEPWindowOperatorParameterDRLBuilder" );
                List<String> params = behavior.getParameters();
                if ( params != null ) {
                    int i = 1;
                    for ( String param : params ) {
                        window.setParameter( "" + i++, param );
                    }
                }
                factPattern.setWindow( window );
            }
        }
View Full Code Here


                generateConstraints( pattern );
            }
            buf.append( ")" );

            //Add CEP window definition
            CEPWindow window = pattern.getWindow();
            if ( window.isDefined() ) {
                buf.append( " " );
                buf.append( window.getOperator() );
                buf.append( buildOperatorParameterDRL( window.getParameters() ) );
            }
        }
View Full Code Here

                         boundParams,
                         dmo );

        for ( BehaviorDescr behavior : pattern.getBehaviors() ) {
            if ( behavior.getText().equals( "window" ) ) {
                CEPWindow window = new CEPWindow();
                window.setOperator( "over window:" + behavior.getSubType() );
                window.setParameter( "org.drools.workbench.models.commons.backend.rule.operatorParameterGenerator",
                                     "org.drools.workbench.models.commons.backend.rule.CEPWindowOperatorParameterDRLBuilder" );
                List<String> params = behavior.getParameters();
                if ( params != null ) {
                    int i = 1;
                    for ( String param : params ) {
                        window.setParameter( "" + i++, param );
                    }
                }
                factPattern.setWindow( window );
            }
        }
View Full Code Here

        assertNull( fp1.getBoundName() );
        assertEquals( 0,
                      fp1.getNumberOfConstraints() );

        assertNotNull( fp1.getWindow() );
        CEPWindow window = fp1.getWindow();
        assertEquals( "over window:time",
                      window.getOperator() );
        assertEquals( 2,
                      window.getParameters().size() );
        assertEquals( "1d",
                      window.getParameter( "1" ) );
        assertEquals( "org.drools.workbench.models.commons.backend.rule.CEPWindowOperatorParameterDRLBuilder",
                      window.getParameter( "org.drools.workbench.models.commons.backend.rule.operatorParameterGenerator" ) );
    }
View Full Code Here

        m.name = "rule1";

        FactPattern fp1 = new FactPattern();
        fp1.setFactType( "Event" );

        CEPWindow window = new CEPWindow();
        window.setOperator( "over window:time" );
        window.getParameters().put( "1",
                                    "1d" );
        window.getParameters().put( "org.drools.workbench.models.commons.backend.rule.operatorParameterGenerator",
                                    "org.drools.workbench.models.commons.backend.rule.CEPWindowOperatorParameterDRLBuilder" );
        fp1.setWindow( window );

        m.addLhsItem( fp1 );
View Full Code Here

        assertNull( fp1.getBoundName() );
        assertEquals( 0,
                      fp1.getNumberOfConstraints() );

        assertNotNull( fp1.getWindow() );
        CEPWindow window = fp1.getWindow();
        assertEquals( "over window:length",
                      window.getOperator() );
        assertEquals( 2,
                      window.getParameters().size() );
        assertEquals( "10",
                      window.getParameter( "1" ) );
        assertEquals( "org.drools.workbench.models.commons.backend.rule.CEPWindowOperatorParameterDRLBuilder",
                      window.getParameter( "org.drools.workbench.models.commons.backend.rule.operatorParameterGenerator" ) );
    }
View Full Code Here

        m.name = "rule1";

        FactPattern fp1 = new FactPattern();
        fp1.setFactType( "Event" );

        CEPWindow window = new CEPWindow();
        window.setOperator( "over window:length" );
        window.getParameters().put( "1",
                                    "10" );
        window.getParameters().put( "org.drools.workbench.models.commons.backend.rule.operatorParameterGenerator",
                                    "org.drools.workbench.models.commons.backend.rule.CEPWindowOperatorParameterDRLBuilder" );
        fp1.setWindow( window );

        m.addLhsItem( fp1 );
View Full Code Here

                generateConstraints( pattern );
            }
            buf.append( ")" );

            //Add CEP window definition
            CEPWindow window = pattern.getWindow();
            if ( window.isDefined() ) {
                buf.append( " " );
                buf.append( window.getOperator() );
                buf.append( buildOperatorParameterDRL( window.getParameters() ) );
            }
        }
View Full Code Here

                         boundParams,
                         dmo );

        for ( BehaviorDescr behavior : pattern.getBehaviors() ) {
            if ( behavior.getText().equals( "window" ) ) {
                CEPWindow window = new CEPWindow();
                window.setOperator( "over window:" + behavior.getSubType() );
                window.setParameter( "org.drools.workbench.models.commons.backend.rule.operatorParameterGenerator",
                                     "org.drools.workbench.models.commons.backend.rule.CEPWindowOperatorParameterDRLBuilder" );
                List<String> params = behavior.getParameters();
                if ( params != null ) {
                    int i = 1;
                    for ( String param : params ) {
                        window.setParameter( "" + i++, param );
                    }
                }
                factPattern.setWindow( window );
            }
        }
View Full Code Here

TOP

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

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.