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

Examples of org.drools.workbench.models.datamodel.rule.CompositeFactPattern.addFactPattern()


        SingleFieldConstraint sf1 = new SingleFieldConstraint( "age" );
        sf1.setOperator( "==" );
        sf1.setValue( "42" );
        p1.addConstraint( sf1 );

        cp.addFactPattern( p1 );

        FactPattern p2 = new FactPattern( "Person" );
        SingleFieldConstraint sf2 = new SingleFieldConstraint( "age" );
        sf2.setOperator( "==" );
        sf2.setValue( "43" );
View Full Code Here


        SingleFieldConstraint sf2 = new SingleFieldConstraint( "age" );
        sf2.setOperator( "==" );
        sf2.setValue( "43" );
        p2.addConstraint( sf2 );

        cp.addFactPattern( p2 );

        m.addLhsItem( cp );

        return m;
    }
View Full Code Here

        final FactPattern fp2 = new FactPattern( "Person" );
        final FromCompositeFactPattern ffp1 = new FromCompositeFactPattern();
        ffp1.setExpression( new ExpressionFormLine( new ExpressionVariable( fp1 ) ) );
        ffp1.setFactPattern( fp2 );
        cp.addFactPattern( ffp1 );
        m.addLhsItem( cp );

        final String actual = RuleModelDRLPersistenceImpl.getInstance().marshal( m );
        final String expected = "rule \"model\"\n" +
                "dialect \"mvel\"\n" +
View Full Code Here

        pat.addConstraint( con );

        m.addLhsItem( pat );

        final CompositeFactPattern comp = new CompositeFactPattern( "not" );
        comp.addFactPattern( new FactPattern( "Cancel" ) );
        m.addLhsItem( comp );

        final ActionUpdateField set = new ActionUpdateField();
        set.setVariable( "p1" );
        set.addFieldValue( new ActionFieldValue( "status",
View Full Code Here

        CompositeFactPattern compositeFactPattern = new CompositeFactPattern(CompositeFactPattern.COMPOSITE_TYPE_OR);
        model.lhs[0] = compositeFactPattern;
        FactPattern pattern1 = new FactPattern();
        pattern1.setBoundName("test");
        compositeFactPattern.addFactPattern(pattern1);
        FactPattern pattern2 = new FactPattern();
        SingleFieldConstraint constraint = new SingleFieldConstraint();
        pattern2.addConstraint(constraint);
        compositeFactPattern.addFactPattern(pattern2);
View Full Code Here

        pattern1.setBoundName("test");
        compositeFactPattern.addFactPattern(pattern1);
        FactPattern pattern2 = new FactPattern();
        SingleFieldConstraint constraint = new SingleFieldConstraint();
        pattern2.addConstraint(constraint);
        compositeFactPattern.addFactPattern(pattern2);

        List<String> boundVariablesInScope = model.getBoundVariablesInScope(constraint);

        assertEquals(1,boundVariablesInScope.size());
    }
View Full Code Here

        model.lhs[0] = compositeFactPattern;
        FactPattern pattern1 = new FactPattern();
        SingleFieldConstraint constraint1 = new SingleFieldConstraint();
        pattern1.addConstraint(constraint1);
        constraint1.setFieldBinding("test");
        compositeFactPattern.addFactPattern(pattern1);
        FactPattern pattern2 = new FactPattern();
        SingleFieldConstraint constraint2 = new SingleFieldConstraint();
        pattern2.addConstraint(constraint2);
        compositeFactPattern.addFactPattern(pattern2);
View Full Code Here

        constraint1.setFieldBinding("test");
        compositeFactPattern.addFactPattern(pattern1);
        FactPattern pattern2 = new FactPattern();
        SingleFieldConstraint constraint2 = new SingleFieldConstraint();
        pattern2.addConstraint(constraint2);
        compositeFactPattern.addFactPattern(pattern2);

        SingleFieldConstraint lhsBoundField = model.getLHSBoundField("test");

        assertEquals(constraint1,lhsBoundField);
    }
View Full Code Here

        FactPattern pattern1 = new FactPattern();
        SingleFieldConstraint constraint1 = new SingleFieldConstraint();
        pattern1.addConstraint(constraint1);
        constraint1.setFieldType("String");
        constraint1.setFieldBinding("test");
        compositeFactPattern.addFactPattern(pattern1);
        FactPattern pattern2 = new FactPattern();
        SingleFieldConstraint constraint2 = new SingleFieldConstraint();
        pattern2.addConstraint(constraint2);
        compositeFactPattern.addFactPattern(pattern2);
View Full Code Here

        constraint1.setFieldBinding("test");
        compositeFactPattern.addFactPattern(pattern1);
        FactPattern pattern2 = new FactPattern();
        SingleFieldConstraint constraint2 = new SingleFieldConstraint();
        pattern2.addConstraint(constraint2);
        compositeFactPattern.addFactPattern(pattern2);

        assertEquals("String", model.getLHSBindingType("test"));
    }
}
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.