Package org.drools.workbench.models.guided.dtable.shared.model

Examples of org.drools.workbench.models.guided.dtable.shared.model.Pattern52


        }
        return type;
    }

    private String getType( final ConditionCol52 col ) {
        final Pattern52 pattern = model.getPattern( col );
        return getType( pattern,
                        col );
    }
View Full Code Here


    }

    public String getBoundFactType( String boundName ) {
        for ( CompositeColumn<?> cc : this.model.getConditions() ) {
            if ( cc instanceof Pattern52 ) {
                final Pattern52 p = (Pattern52) cc;
                if ( p.isBound() && p.getBoundName().equals( boundName ) ) {
                    return p.getFactType();
                }
            } else if ( cc instanceof BRLConditionColumn ) {
                final BRLConditionColumn brl = (BRLConditionColumn) cc;
                for ( IPattern p : brl.getDefinition() ) {
                    if ( p instanceof FactPattern ) {
View Full Code Here

        final Map<String, String> currentValueMap = new HashMap<String, String>();

        // add cols for LHS
        final ConditionCol52 c1 = new ConditionCol52();
        final Pattern52 p1 = new Pattern52();
        p1.setBoundName( "c1" );
        p1.setFactType( "Driver" );
        c1.setFactField( "name" );
        c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p1.getChildColumns().add( c1 );
        dt.getConditions().add( p1 );

        final ConditionCol52 c1_ = new ConditionCol52();
        final Pattern52 p1_ = new Pattern52();
        p1_.setBoundName( "c1" );
        p1_.setFactType( "Driver" );
        c1_.setFactField( "name" );
        p1_.getChildColumns().add( c1_ );
        c1_.setConstraintValueType( BaseSingleFieldConstraint.TYPE_RET_VALUE );
        dt.getConditions().add( p1_ );

        final ConditionCol52 c1__ = new ConditionCol52();
        c1__.setFactField( "sex" );
        p1_.getChildColumns().add( c1__ );
        c1__.setConstraintValueType( BaseSingleFieldConstraint.TYPE_RET_VALUE );
        c1__.setValueList( "Male,Female" );
        dt.getConditions().add( p1_ );

        final ConditionCol52 c1___ = new ConditionCol52();
        final Pattern52 p1__ = new Pattern52();
        p1__.setBoundName( "c1" );
        p1__.setFactType( "Driver" );
        c1___.setFactField( "name" );
        c1___.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        c1___.setValueList( "one,two,three" );
        p1__.getChildColumns().add( c1___ );
        dt.getConditions().add( p1__ );

        final ConditionCol52 c2 = new ConditionCol52();
        final Pattern52 p2 = new Pattern52();
        p2.setBoundName( "c2" );
        p2.setFactType( "Driver" );
        c2.setFactField( "nothing" );
        c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p2.getChildColumns().add( c2 );
        dt.getConditions().add( p2 );

        final ActionSetFieldCol52 asf = new ActionSetFieldCol52();
        asf.setBoundName( "c1" );
        asf.setFactField( "name" );
View Full Code Here

        dt.getAttributeCols().add( at );
        dt.getAttributeCols().add( at_ );

        final ConditionCol52 c1 = new ConditionCol52();
        final Pattern52 p1 = new Pattern52();
        p1.setBoundName( "c1" );
        p1.setFactType( "Driver" );
        c1.setFactField( "name" );
        c1.setOperator( "==" );
        c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p1.getChildColumns().add( c1 );
        dt.getConditions().add( p1 );

        final ConditionCol52 c1_ = new ConditionCol52();
        final Pattern52 p1_ = new Pattern52();
        p1_.setBoundName( "c1" );
        p1_.setFactType( "Driver" );
        c1_.setFactField( "age" );
        c1_.setOperator( "==" );
        c1_.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p1_.getChildColumns().add( c1_ );
        dt.getConditions().add( p1_ );

        final ConditionCol52 c2 = new ConditionCol52();
        final Pattern52 p2 = new Pattern52();
        p2.setBoundName( "c1" );
        p2.setFactType( "Driver" );
        c2.setFactField( "age" );
        c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p2.getChildColumns().add( c2 );
        dt.getConditions().add( p2 );

        final ActionSetFieldCol52 a = new ActionSetFieldCol52();
        a.setBoundName( "c1" );
        a.setFactField( "name" );
View Full Code Here

        enabledAttribute.setAttribute( "enabled" );

        dt.getAttributeCols().add( salienceAttribute );
        dt.getAttributeCols().add( enabledAttribute );

        final Pattern52 p1 = new Pattern52();

        final ConditionCol52 conditionColName = new ConditionCol52();
        p1.setBoundName( "c1" );
        p1.setFactType( "Driver" );
        conditionColName.setFactField( "name" );
        conditionColName.setOperator( "==" );
        conditionColName.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p1.getChildColumns().add( conditionColName );

        final ConditionCol52 conditionColAge = new ConditionCol52();
        conditionColAge.setFactField( "age" );
        conditionColAge.setOperator( "==" );
        conditionColAge.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p1.getChildColumns().add( conditionColAge );

        final ConditionCol52 conditionColDate = new ConditionCol52();
        conditionColDate.setFactField( "date" );
        conditionColDate.setOperator( "==" );
        conditionColDate.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p1.getChildColumns().add( conditionColDate );

        final ConditionCol52 conditionColApproved = new ConditionCol52();
        conditionColApproved.setFactField( "approved" );
        conditionColApproved.setOperator( "==" );
        conditionColApproved.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p1.getChildColumns().add( conditionColApproved );

        final ConditionCol52 conditionColAge2 = new ConditionCol52();
        conditionColAge2.setFactField( "age" );
        conditionColAge2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p1.getChildColumns().add( conditionColAge2 );

        dt.getConditions().add( p1 );

        final ActionSetFieldCol52 a = new ActionSetFieldCol52();
        a.setBoundName( "c1" );
View Full Code Here

        final GuidedDecisionTableUtils utils = new GuidedDecisionTableUtils( oracle,
                                                                             dt );

        // add cols for LHS
        final ConditionCol52 c1 = new ConditionCol52();
        final Pattern52 p1 = new Pattern52();
        p1.setBoundName( "c1" );
        p1.setFactType( "Driver" );
        c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p1.getChildColumns().add( c1 );
        dt.getConditions().add( p1 );

        final ConditionCol52 c2 = new ConditionCol52();
        final Pattern52 p2 = new Pattern52();
        p2.setBoundName( "c2" );
        p2.setFactType( "Driver" );
        c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        c2.setValueList( "a,b,c" );
        p2.getChildColumns().add( c2 );
        dt.getConditions().add( p1 );

        assertEquals( 0,
                      utils.getValueList( c1 ).length );
        assertEquals( 3,
View Full Code Here

        aifc.setBoundName( "d2" );
        aifc.setFactType( "Driver" );
        aifc.setFactField( "age" );

        final ConditionCol52 c1 = new ConditionCol52();
        Pattern52 p1 = new Pattern52();
        p1.setBoundName( "c1" );
        p1.setFactType( "Driver" );
        c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p1.getChildColumns().add( c1 );
        dt.getConditions().add( p1 );

        final ConditionCol52 c2 = new ConditionCol52();
        Pattern52 p2 = new Pattern52();
        p2.setBoundName( "c2" );
        p2.setFactType( "Driver" );
        c2.setFactField( "age" );
        c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p2.getChildColumns().add( c2 );
        dt.getConditions().add( p2 );

        final ConditionCol52 c3 = new ConditionCol52();
        Pattern52 p3 = new Pattern52();
        p3.setBoundName( "c3" );
        p3.setFactType( "Driver" );
        c3.setOperator( "==" );
        c3.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p3.getChildColumns().add( c3 );
        dt.getConditions().add( p3 );

        final ConditionCol52 c4 = new ConditionCol52();
        Pattern52 p4 = new Pattern52();
        p4.setBoundName( "c4" );
        p4.setFactType( "Driver" );
        c4.setFactField( "age" );
        c4.setOperator( "==" );
        c4.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p4.getChildColumns().add( c4 );
        dt.getConditions().add( p4 );

        final ConditionCol52 c5 = new ConditionCol52();
        Pattern52 p5 = new Pattern52();
        p5.setBoundName( "c5" );
        p5.setFactType( "Driver" );
        c5.setConstraintValueType( BaseSingleFieldConstraint.TYPE_PREDICATE );
        p5.getChildColumns().add( c5 );
        dt.getConditions().add( p5 );

        final ConditionCol52 c6 = new ConditionCol52();
        Pattern52 p6 = new Pattern52();
        p6.setBoundName( "c6" );
        p6.setFactType( "Driver" );
        c6.setConstraintValueType( BaseSingleFieldConstraint.TYPE_RET_VALUE );
        p6.getChildColumns().add( c6 );
        dt.getConditions().add( p6 );

        assertTrue( utils.isConstraintValid( rnc ) );
        assertTrue( utils.isConstraintValid( dc ) );
        assertTrue( utils.isConstraintValid( mdc ) );
View Full Code Here

        final GuidedDecisionTableUtils utils = new GuidedDecisionTableUtils( oracle,
                                                                             dt );

        final ConditionCol52 c1 = new ConditionCol52();
        final Pattern52 p1 = new Pattern52();
        p1.setBoundName( "c1" );
        p1.setFactType( "Driver" );
        c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_PREDICATE );
        c1.setFieldType( DataType.TYPE_STRING );
        c1.setValueList( "age>10,age>20,age>30" );
        p1.getChildColumns().add( c1 );
        dt.getConditions().add( p1 );

        assertTrue( utils.getValueList( c1 ).length > 0 );
        assertTrue( utils.getValueList( c1 ).length == 3 );
        assertEquals( "age>10",
View Full Code Here

        final GuidedDecisionTableUtils utils = new GuidedDecisionTableUtils( oracle,
                                                                             dt );

        final ConditionCol52 c1 = new ConditionCol52();
        final Pattern52 p1 = new Pattern52();
        p1.setBoundName( "c1" );
        p1.setFactType( "Driver" );
        c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_RET_VALUE );
        c1.setFieldType( DataType.TYPE_STRING );
        c1.setValueList( "getAge()>10,getAge()>20,getAge()>30" );
        p1.getChildColumns().add( c1 );
        dt.getConditions().add( p1 );

        assertTrue( utils.getValueList( c1 ).length > 0 );
        assertTrue( utils.getValueList( c1 ).length == 3 );
        assertEquals( "getAge()>10",
View Full Code Here

        final GuidedDecisionTable52 dt = new GuidedDecisionTable52();
        dt.setPackageName( packageName );
        dt.getImports().getImports().addAll( imports );
        dt.setTableName( tableName );

        Pattern52 p1 = new Pattern52();
        p1.setBoundName( "$a" );
        p1.setFactType( "Applicant" );

        ConditionCol52 con1 = new ConditionCol52();
        con1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        con1.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
        con1.setFactField( "age" );
        con1.setHeader( "Applicant age" );
        con1.setOperator( "==" );
        p1.getChildColumns().add( con1 );

        dt.getConditions().add( p1 );

        Pattern52 p2 = new Pattern52();
        p2.setBoundName( "$m" );
        p2.setFactType( "Mortgage" );

        ConditionCol52 con2 = new ConditionCol52();
        con2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        con2.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
        con2.setFactField( "amount" );
        con2.setHeader( "Mortgage amount" );
        con2.setOperator( "==" );
        p2.getChildColumns().add( con2 );

        dt.getConditions().add( p2 );

        dt.setData( DataUtilities.makeDataLists( new String[][]{
                new String[]{ "1", "desc", "33", "" }
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.guided.dtable.shared.model.Pattern52

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.