Package org.drools.ide.common.client.modeldriven.brl

Examples of org.drools.ide.common.client.modeldriven.brl.CompositeFactPattern


        TemplateModel model = new TemplateModel();

        model.lhs = new IPattern[1];

        //One field is a Template Key the other is a literal
        CompositeFactPattern cfp0 = new CompositeFactPattern();
        cfp0.type = CompositeFactPattern.COMPOSITE_TYPE_OR;

        FactPattern fp0 = new FactPattern();
        fp0.setBoundName( "$t0" );
        fp0.setFactType( "FT0" );
        fp0.setNegated( true );

        SingleFieldConstraint fp0sfc0 = new SingleFieldConstraint();
        fp0sfc0.setConstraintValueType( BaseSingleFieldConstraint.TYPE_TEMPLATE );
        fp0sfc0.setFieldBinding( "$fp0sfc0" );
        fp0sfc0.setFactType( "FT0" );
        fp0sfc0.setFieldName( "fp0sfc0" );
        fp0sfc0.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
        fp0sfc0.setOperator( "==" );
        fp0sfc0.setValue( "fp0sfc0Value" );
        fp0.addConstraint( fp0sfc0 );

        SingleFieldConstraint fp0sfc1 = new SingleFieldConstraint();
        fp0sfc1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        fp0sfc1.setFieldBinding( "$fp0sfc1" );
        fp0sfc1.setFactType( "FT0" );
        fp0sfc1.setFieldName( "fp0sfc1" );
        fp0sfc1.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
        fp0sfc1.setOperator( "==" );
        fp0sfc1.setValue( "fp0sfc1Value" );
        fp0.addConstraint( fp0sfc1 );

        FactPattern fp1 = new FactPattern();
        fp1.setBoundName( "$t1" );
        fp1.setFactType( "FT1" );
        fp1.setNegated( true );

        SingleFieldConstraint fp1sfc0 = new SingleFieldConstraint();
        fp1sfc0.setConstraintValueType( BaseSingleFieldConstraint.TYPE_TEMPLATE );
        fp1sfc0.setFieldBinding( "$fp1sfc0" );
        fp1sfc0.setFactType( "FT1" );
        fp1sfc0.setFieldName( "fp1sfc0" );
        fp1sfc0.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
        fp1sfc0.setOperator( "==" );
        fp1sfc0.setValue( "fp1sfc0Value" );
        fp1.addConstraint( fp1sfc0 );

        cfp0.addFactPattern( fp0 );
        cfp0.addFactPattern( fp1 );

        model.lhs[0] = cfp0;

        //Test first pattern, with two Template Keys
        RuleModelPeerVariableVisitor visitor0 = new RuleModelPeerVariableVisitor( model,
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.brl.CompositeFactPattern

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.