Examples of RuleModel


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

                      efl0Clone.getCurrentName() );
    }

    @Test
    public void testCompositeFactPatterns() {
        RuleModel model = new RuleModel();

        model.lhs = new IPattern[1];
        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_LITERAL );
        fp0sfc0.setFieldBinding( "$fp0sfc0" );
        fp0sfc0.setFieldName( "fp0sfc0" );
        fp0sfc0.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
        fp0sfc0.setOperator( "==" );
        fp0sfc0.setParameter( "fp0sfc0p0",
                              "fp0sfc0p0Value" );
        fp0sfc0.setValue( "fp0sfc0Value" );
        fp0.addConstraint( fp0sfc0 );

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

        SingleFieldConstraint fp1sfc0 = new SingleFieldConstraint();
        fp1sfc0.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        fp1sfc0.setFieldBinding( "$fp1sfc0" );
        fp1sfc0.setFieldName( "fp1sfc0" );
        fp1sfc0.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
        fp1sfc0.setOperator( "==" );
        fp1sfc0.setParameter( "fp1sfc0p0",
                              "fp1sfc0p0Value" );
        fp1sfc0.setValue( "fp1sfc0Value" );
        fp1.addConstraint( fp1sfc0 );

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

        model.lhs[0] = cfp0;

        RuleModelCloneVisitor cloneVisitor = new RuleModelCloneVisitor();
        RuleModel clone = cloneVisitor.visitRuleModel( model );

        assertEquals( 1,
                      clone.lhs.length );
        assertNotSame( model.lhs[0],
                       clone.lhs[0] );
View Full Code Here

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

                      fp1sfc0Clone.getValue() );
    }

    @Test
    public void testFreeFormLine() {
        RuleModel model = new RuleModel();

        model.lhs = new IPattern[1];
        FreeFormLine ffl0 = new FreeFormLine();
        ffl0.text = "ffl0";
        model.lhs[0] = ffl0;

        RuleModelCloneVisitor cloneVisitor = new RuleModelCloneVisitor();
        RuleModel clone = cloneVisitor.visitRuleModel( model );

        assertEquals( 1,
                      clone.lhs.length );
        assertNotSame( model.lhs[0],
                       clone.lhs[0] );
View Full Code Here

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

                      ffl0Clone.text );
    }

    @Test
    public void testFromAccumulateCompositeFactPattern() {
        RuleModel model = new RuleModel();

        model.lhs = new IPattern[1];
        FromAccumulateCompositeFactPattern fp0 = new FromAccumulateCompositeFactPattern();
        fp0.setActionCode( "fp0.actionCode" );
        ExpressionFormLine efl0 = new ExpressionFormLine();
        efl0.setBinding( "$efl0" );
        ExpressionText efl0p0 = new ExpressionText( "efl0p0" );
        efl0.appendPart( efl0p0 );
        fp0.setExpression( efl0 );
        FactPattern fp0FactPattern = new FactPattern( "fp0FactPattern" );
        fp0.setFactPattern( fp0FactPattern );
        fp0.setFunction( "fp0.function" );
        fp0.setInitCode( "fp0.initCode" );
        fp0.setResultCode( "fp0.resultCode" );
        fp0.setReverseCode( "fp0.reverseCode" );
        FactPattern fp0SourcePattern = new FactPattern( "fp0SourcePattern" );
        fp0.setSourcePattern( fp0SourcePattern );

        model.lhs[0] = fp0;

        RuleModelCloneVisitor cloneVisitor = new RuleModelCloneVisitor();
        RuleModel clone = cloneVisitor.visitRuleModel( model );

        assertEquals( 1,
                      clone.lhs.length );
        assertNotSame( model.lhs[0],
                       clone.lhs[0] );
View Full Code Here

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

                      fp0SourcePatternClone.getFactType() );
    }

    @Test
    public void testFromCollectCompositeFactPattern() {
        RuleModel model = new RuleModel();

        model.lhs = new IPattern[1];
        FromCollectCompositeFactPattern fp0 = new FromCollectCompositeFactPattern();
        ExpressionFormLine efl0 = new ExpressionFormLine();
        efl0.setBinding( "$efl0" );
        ExpressionText efl0p0 = new ExpressionText( "efl0p0" );
        efl0.appendPart( efl0p0 );
        fp0.setExpression( efl0 );
        FactPattern fp0FactPattern = new FactPattern( "fp0FactPattern" );
        fp0.setFactPattern( fp0FactPattern );
        FactPattern fp0RightPattern = new FactPattern( "fp0RightPattern" );
        fp0.setRightPattern( fp0RightPattern );

        model.lhs[0] = fp0;

        RuleModelCloneVisitor cloneVisitor = new RuleModelCloneVisitor();
        RuleModel clone = cloneVisitor.visitRuleModel( model );

        assertEquals( 1,
                      clone.lhs.length );
        assertNotSame( model.lhs[0],
                       clone.lhs[0] );
View Full Code Here

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

                      fp0RightPatternClone.getFactType() );
    }

    @Test
    public void testFromCompositeFactPattern() {
        RuleModel model = new RuleModel();

        model.lhs = new IPattern[1];
        FromCompositeFactPattern fp0 = new FromCompositeFactPattern();
        ExpressionFormLine efl0 = new ExpressionFormLine();
        efl0.setBinding( "$efl0" );
        ExpressionText efl0p0 = new ExpressionText( "efl0p0" );
        efl0.appendPart( efl0p0 );
        fp0.setExpression( efl0 );
        FactPattern fp0FactPattern = new FactPattern( "fp0FactPattern" );
        fp0.setFactPattern( fp0FactPattern );

        model.lhs[0] = fp0;

        RuleModelCloneVisitor cloneVisitor = new RuleModelCloneVisitor();
        RuleModel clone = cloneVisitor.visitRuleModel( model );

        assertEquals( 1,
                      clone.lhs.length );
        assertNotSame( model.lhs[0],
                       clone.lhs[0] );
View Full Code Here

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

        col1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        col1.setOperator( "" );
        p1.getChildColumns().add( col1 );
        allColumns.add( col1 );

        RuleModel rm = new RuleModel();

        //When using a TemplateDataProvider the assumption is that we
        //have a "complete" decision table including AnalysisCol52
        allColumns.add( new AnalysisCol52() );
View Full Code Here

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

        ins2.setFactType( "Cheese" );
        ins2.setFactField( "type" );
        ins2.setType( SuggestionCompletionEngine.TYPE_NUMERIC );
        cols.add( ins2 );

        RuleModel rm = new RuleModel();
        allColumns.addAll( cols );

        //When using a TemplateDataProvider the assumption is that we
        //have a "complete" decision table including AnalysisCol52
        allColumns.add( new AnalysisCol52() );
View Full Code Here

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

        p4.setValue( "hello" );
        pwd.addParameter( p4 );

        cols.add( awi );

        RuleModel rm = new RuleModel();
        allColumns.addAll( cols );

        //When using a TemplateDataProvider the assumption is that we
        //have a "complete" decision table including AnalysisCol52
        allColumns.add( new AnalysisCol52() );
View Full Code Here

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

        p4.setBinding( "$s" );
        pwd.addParameter( p4 );

        cols.add( awi );

        RuleModel rm = new RuleModel();
        allColumns.addAll( cols );

        //When using a TemplateDataProvider the assumption is that we
        //have a "complete" decision table including AnalysisCol52
        allColumns.add( new AnalysisCol52() );
View Full Code Here

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

        asf4.setWorkItemName( "WorkItem" );
        asf4.setWorkItemResultParameterName( "StringResult" );
        asf4.setParameterClassName( String.class.getName() );
        cols.add( asf4 );

        RuleModel rm = new RuleModel();
        allColumns.addAll( cols );

        //When using a TemplateDataProvider the assumption is that we
        //have a "complete" decision table including AnalysisCol52
        allColumns.add( new AnalysisCol52() );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.