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

Examples of org.drools.ide.common.client.modeldriven.dt.ConditionCol


    }

    @Test
    public void testUpdateModify() {
        TypeSafeGuidedDecisionTable dt = new TypeSafeGuidedDecisionTable();
        ConditionCol c = new ConditionCol();
        c.setBoundName( "x" );
        c.setFactType( "Context" );
        c.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( c );
        ActionSetFieldCol asf = new ActionSetFieldCol();
        asf.setBoundName( "x" );
        asf.setFactField( "age" );
        asf.setType( "String" );
View Full Code Here


        allColumns.add( new RowNumberCol() );
        allColumns.add( new DescriptionCol() );
        allColumns.add( new MetadataCol() );
        List<ConditionCol> cols = new ArrayList<ConditionCol>();

        ConditionCol col2 = new ConditionCol();
        col2.setBoundName( "p1" );
        col2.setFactType( "Person" );
        col2.setFactField( "age" );
        col2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        col2.setOperator( "" );
        cols.add( col2 );

        RuleModel rm = new RuleModel();
        allColumns.addAll( cols );
View Full Code Here

        allColumns.add( new RowNumberCol() );
        allColumns.add( new DescriptionCol() );
        allColumns.add( new MetadataCol() );
        List<ConditionCol> cols = new ArrayList<ConditionCol>();

        ConditionCol col = new ConditionCol();
        col.setBoundName( "p1" );
        col.setFactType( "Person" );
        col.setFactField( "name" );
        col.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        col.setOperator( "==" );
        col.setNegated( true );
        cols.add( col );

        ConditionCol col2 = new ConditionCol();
        col2.setBoundName( "p1" );
        col2.setFactType( "Person" );
        col2.setFactField( "age" );
        col2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_RET_VALUE );
        col2.setOperator( "<" );
        col2.setNegated( true );
        cols.add( col2 );

        ConditionCol col3 = new ConditionCol();
        col3.setBoundName( "p1" );
        col3.setFactType( "Person" );
        col3.setConstraintValueType( BaseSingleFieldConstraint.TYPE_PREDICATE );
        col3.setNegated( true );
        cols.add( col3 );

        ConditionCol col4 = new ConditionCol();
        col4.setBoundName( "c" );
        col4.setFactType( "Cheese" );
        col4.setFactField( "type" );
        col4.setOperator( "==" );
        col4.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cols.add( col4 );

        RuleModel rm = new RuleModel();
        allColumns.addAll( cols );
View Full Code Here

    @Test
    public void testNoConstraintLists() {
        TypeSafeGuidedDecisionTable dt = new TypeSafeGuidedDecisionTable();

        // add cols for LHS
        ConditionCol c1 = new ConditionCol();
        c1.setBoundName( "c1" );
        c1.setFactType( "Driver" );
        c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( c1 );

        ConditionCol c2 = new ConditionCol();
        c2.setBoundName( "c2" );
        c2.setFactType( "Driver" );
        c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        c2.setValueList( "a,b,c" );
        dt.getConditionCols().add( c2 );

        SuggestionCompletionEngine sce = new SuggestionCompletionEngine();
        sce.putDataEnumList( "Driver.name",
                             new String[]{"bob", "michael"} );
View Full Code Here

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

        ConditionCol c1 = new ConditionCol();
        c1.setBoundName( "c1" );
        c1.setFactType( "Driver" );
        c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( c1 );

        ConditionCol c2 = new ConditionCol();
        c2.setBoundName( "c2" );
        c2.setFactType( "Driver" );
        c2.setFactField( "age" );
        c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( c2 );

        ConditionCol c3 = new ConditionCol();
        c3.setBoundName( "c3" );
        c3.setFactType( "Driver" );
        c3.setOperator( "==" );
        c3.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( c3 );

        ConditionCol c4 = new ConditionCol();
        c4.setBoundName( "c4" );
        c4.setFactType( "Driver" );
        c4.setFactField( "age" );
        c4.setOperator( "==" );
        c4.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( c4 );

        ConditionCol c5 = new ConditionCol();
        c5.setBoundName( "c5" );
        c5.setFactType( "Driver" );
        c5.setConstraintValueType( BaseSingleFieldConstraint.TYPE_PREDICATE );
        dt.getConditionCols().add( c5 );

        ConditionCol c6 = new ConditionCol();
        c6.setBoundName( "c6" );
        c6.setFactType( "Driver" );
        c6.setConstraintValueType( BaseSingleFieldConstraint.TYPE_RET_VALUE );
        dt.getConditionCols().add( c6 );

        SuggestionCompletionEngine sce = new SuggestionCompletionEngine();

        sce.setFieldsForTypes( new HashMap<String, ModelField[]>() {
View Full Code Here

    @Test
    public void testValueLists() {
        TypeSafeGuidedDecisionTable dt = new TypeSafeGuidedDecisionTable();

        // add cols for LHS
        ConditionCol c1 = new ConditionCol();
        c1.setBoundName( "c1" );
        c1.setFactType( "Driver" );
        c1.setFactField( "name" );
        c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( c1 );

        ConditionCol c1_ = new ConditionCol();
        c1_.setBoundName( "c1" );
        c1_.setFactType( "Driver" );
        c1_.setFactField( "name" );
        c1_.setConstraintValueType( BaseSingleFieldConstraint.TYPE_RET_VALUE );

        dt.getConditionCols().add( c1_ );

        ConditionCol c1__ = new ConditionCol();
        c1__.setBoundName( "c1" );
        c1__.setFactType( "Driver" );
        c1__.setFactField( "name" );
        c1__.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        c1__.setValueList( "one,two,three" );
        dt.getConditionCols().add( c1__ );

        ConditionCol c2 = new ConditionCol();
        c2.setBoundName( "c2" );
        c2.setFactType( "Driver" );
        c2.setFactField( "nothing" );
        c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( c2 );

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

        at_.setAttribute( "enabled" );

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

        ConditionCol c1 = new ConditionCol();
        c1.setBoundName( "c1" );
        c1.setFactType( "Driver" );
        c1.setFactField( "name" );
        c1.setOperator( "==" );
        c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( c1 );

        ConditionCol c1_ = new ConditionCol();
        c1_.setBoundName( "c1" );
        c1_.setFactType( "Driver" );
        c1_.setFactField( "age" );
        c1_.setOperator( "==" );
        c1_.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( c1_ );

        ConditionCol c2 = new ConditionCol();
        c2.setBoundName( "c1" );
        c2.setFactType( "Driver" );
        c2.setFactField( "age" );
        c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( c2 );

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

        enabledAttribute.setAttribute( "enabled" );

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

        ConditionCol conditionColName = new ConditionCol();
        conditionColName.setBoundName( "c1" );
        conditionColName.setFactType( "Driver" );
        conditionColName.setFactField( "name" );
        conditionColName.setOperator( "==" );
        conditionColName.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( conditionColName );

        ConditionCol conditionColAge = new ConditionCol();
        conditionColAge.setBoundName( "c1" );
        conditionColAge.setFactType( "Driver" );
        conditionColAge.setFactField( "age" );
        conditionColAge.setOperator( "==" );
        conditionColAge.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( conditionColAge );

        ConditionCol conditionColDate = new ConditionCol();
        conditionColDate.setBoundName( "c1" );
        conditionColDate.setFactType( "Driver" );
        conditionColDate.setFactField( "date" );
        conditionColDate.setOperator( "==" );
        conditionColDate.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( conditionColDate );

        ConditionCol conditionColApproved = new ConditionCol();
        conditionColApproved.setBoundName( "c1" );
        conditionColApproved.setFactType( "Driver" );
        conditionColApproved.setFactField( "approved" );
        conditionColApproved.setOperator( "==" );
        conditionColApproved.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( conditionColApproved );

        ConditionCol conditionColAge2 = new ConditionCol();
        conditionColAge2.setBoundName( "c1" );
        conditionColAge2.setFactType( "Driver" );
        conditionColAge2.setFactField( "age" );
        conditionColAge2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        dt.getConditionCols().add( conditionColAge2 );

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

        allColumns.add( new RowNumberCol() );
        allColumns.add( new DescriptionCol() );
        allColumns.add( new MetadataCol() );
        List<ConditionCol> cols = new ArrayList<ConditionCol>();

        ConditionCol col = new ConditionCol();
        col.setBoundName( "p1" );
        col.setFactType( "Person" );
        col.setFactField( "name" );
        col.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        col.setOperator( "==" );
        cols.add( col );

        ConditionCol col2 = new ConditionCol();
        col2.setBoundName( "p1" );
        col2.setFactType( "Person" );
        col2.setFactField( "age" );
        col2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_RET_VALUE );
        col2.setOperator( "<" );
        cols.add( col2 );

        ConditionCol col3 = new ConditionCol();
        col3.setBoundName( "p1" );
        col3.setFactType( "Person" );
        col3.setConstraintValueType( BaseSingleFieldConstraint.TYPE_PREDICATE );
        cols.add( col3 );

        ConditionCol col4 = new ConditionCol();
        col4.setBoundName( "c" );
        col4.setFactType( "Cheese" );
        col4.setFactField( "type" );
        col4.setOperator( "==" );
        col4.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cols.add( col4 );

        RuleModel rm = new RuleModel();
        allColumns.addAll( cols );
View Full Code Here

        allColumns.add( new RowNumberCol() );
        allColumns.add( new DescriptionCol() );
        allColumns.add( new MetadataCol() );
        List<ConditionCol> cols = new ArrayList<ConditionCol>();

        ConditionCol col = new ConditionCol();
        col.setBoundName( "p1" );
        col.setFactType( "Person" );
        col.setFactField( "name" );
        col.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        col.setOperator( "==" );
        col.setNegated( true );
        cols.add( col );

        ConditionCol col2 = new ConditionCol();
        col2.setBoundName( "p1" );
        col2.setFactType( "Person" );
        col2.setFactField( "age" );
        col2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_RET_VALUE );
        col2.setOperator( "<" );
        col2.setNegated( true );
        cols.add( col2 );

        ConditionCol col3 = new ConditionCol();
        col3.setBoundName( "p1" );
        col3.setFactType( "Person" );
        col3.setConstraintValueType( BaseSingleFieldConstraint.TYPE_PREDICATE );
        col3.setNegated( true );
        cols.add( col3 );

        ConditionCol col4 = new ConditionCol();
        col4.setBoundName( "c" );
        col4.setFactType( "Cheese" );
        col4.setFactField( "type" );
        col4.setOperator( "==" );
        col4.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cols.add( col4 );

        RuleModel rm = new RuleModel();
        allColumns.addAll( cols );
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.dt.ConditionCol

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.