Package org.drools.ide.common.shared.workitems

Examples of org.drools.ide.common.shared.workitems.PortableFloatParameterDefinition


        PortableBooleanParameterDefinition p1 = new PortableBooleanParameterDefinition();
        p1.setName( "BooleanParameter" );
        p1.setValue( Boolean.TRUE );
        pwd.addParameter( p1 );

        PortableFloatParameterDefinition p2 = new PortableFloatParameterDefinition();
        p2.setName( "FloatParameter" );
        p2.setValue( 123.456f );
        pwd.addParameter( p2 );

        PortableIntegerParameterDefinition p3 = new PortableIntegerParameterDefinition();
        p3.setName( "IntegerParameter" );
        p3.setValue( 123 );
        pwd.addParameter( p3 );

        PortableStringParameterDefinition p4 = new PortableStringParameterDefinition();
        p4.setName( "StringParameter" );
        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() );

        List<DTCellValue52> rowData = upgrader.makeDataRowList( row );
        TemplateDataProvider rowDataProvider = new GuidedDTTemplateDataProvider( allColumns,
                                                                                 rowData );

        p.doActions( allColumns,
                     cols,
                     rowDataProvider,
                     rowData,
                     rm );
        assertEquals( 1,
                      rm.rhs.length );

        //Examine RuleModel action
        ActionExecuteWorkItem aw = (ActionExecuteWorkItem) rm.rhs[0];
        assertNotNull( aw );

        PortableWorkDefinition mpwd = aw.getWorkDefinition();
        assertNotNull( mpwd );

        assertEquals( 4,
                      mpwd.getParameters().size() );

        PortableBooleanParameterDefinition mp1 = (PortableBooleanParameterDefinition) mpwd.getParameter( "BooleanParameter" );
        assertNotNull( mp1 );
        assertEquals( Boolean.TRUE,
                      mp1.getValue() );

        PortableFloatParameterDefinition mp2 = (PortableFloatParameterDefinition) mpwd.getParameter( "FloatParameter" );
        assertNotNull( mp2 );
        assertEquals( new Float( 123.456f ),
                      mp2.getValue() );

        PortableIntegerParameterDefinition mp3 = (PortableIntegerParameterDefinition) mpwd.getParameter( "IntegerParameter" );
        assertNotNull( mp3 );
        assertEquals( new Integer( 123 ),
                      mp3.getValue() );
View Full Code Here


        p1.setName( "BooleanParameter" );
        p1.setValue( Boolean.TRUE );
        p1.setBinding( "$b" );
        pwd.addParameter( p1 );

        PortableFloatParameterDefinition p2 = new PortableFloatParameterDefinition();
        p2.setName( "FloatParameter" );
        p2.setValue( 123.456f );
        p2.setBinding( "$f" );
        pwd.addParameter( p2 );

        PortableIntegerParameterDefinition p3 = new PortableIntegerParameterDefinition();
        p3.setName( "IntegerParameter" );
        p3.setValue( 123 );
        p3.setBinding( "$i" );
        pwd.addParameter( p3 );

        PortableStringParameterDefinition p4 = new PortableStringParameterDefinition();
        p4.setName( "StringParameter" );
        p4.setValue( "hello" );
        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() );

        List<DTCellValue52> rowData = upgrader.makeDataRowList( row );
        TemplateDataProvider rowDataProvider = new GuidedDTTemplateDataProvider( allColumns,
                                                                                 rowData );

        p.doActions( allColumns,
                     cols,
                     rowDataProvider,
                     rowData,
                     rm );
        assertEquals( 1,
                      rm.rhs.length );

        //Examine RuleModel action
        ActionExecuteWorkItem aw = (ActionExecuteWorkItem) rm.rhs[0];
        assertNotNull( aw );

        PortableWorkDefinition mpwd = aw.getWorkDefinition();
        assertNotNull( mpwd );

        assertEquals( 4,
                      mpwd.getParameters().size() );

        PortableBooleanParameterDefinition mp1 = (PortableBooleanParameterDefinition) mpwd.getParameter( "BooleanParameter" );
        assertNotNull( mp1 );
        assertEquals( Boolean.TRUE,
                      mp1.getValue() );
        assertEquals( "$b",
                      mp1.getBinding() );

        PortableFloatParameterDefinition mp2 = (PortableFloatParameterDefinition) mpwd.getParameter( "FloatParameter" );
        assertNotNull( mp2 );
        assertEquals( new Float( 123.456f ),
                      mp2.getValue() );
        assertEquals( "$f",
                      mp2.getBinding() );

        PortableIntegerParameterDefinition mp3 = (PortableIntegerParameterDefinition) mpwd.getParameter( "IntegerParameter" );
        assertNotNull( mp3 );
        assertEquals( new Integer( 123 ),
                      mp3.getValue() );
View Full Code Here

        PortableBooleanParameterDefinition p1 = new PortableBooleanParameterDefinition();
        p1.setName( "BooleanResult" );
        pwd.addResult( p1 );

        PortableFloatParameterDefinition p2 = new PortableFloatParameterDefinition();
        p2.setName( "FloatResult" );
        pwd.addResult( p2 );

        PortableIntegerParameterDefinition p3 = new PortableIntegerParameterDefinition();
        p3.setName( "IntegerResult" );
        pwd.addResult( p3 );

        PortableStringParameterDefinition p4 = new PortableStringParameterDefinition();
        p4.setName( "StringResult" );
        pwd.addResult( p4 );

        cols.add( awi );

        ActionWorkItemSetFieldCol52 asf1 = new ActionWorkItemSetFieldCol52();
        asf1.setBoundName( "$r" );
        asf1.setFactField( "ResultBooleanField" );
        asf1.setType( SuggestionCompletionEngine.TYPE_BOOLEAN );
        asf1.setWorkItemName( "WorkItem" );
        asf1.setWorkItemResultParameterName( "BooleanResult" );
        asf1.setParameterClassName( Boolean.class.getName() );
        cols.add( asf1 );

        ActionWorkItemSetFieldCol52 asf2 = new ActionWorkItemSetFieldCol52();
        asf2.setBoundName( "$r" );
        asf2.setFactField( "ResultFloatField" );
        asf2.setType( SuggestionCompletionEngine.TYPE_NUMERIC );
        asf2.setWorkItemName( "WorkItem" );
        asf2.setWorkItemResultParameterName( "FloatResult" );
        asf2.setParameterClassName( Float.class.getName() );
        cols.add( asf2 );

        ActionWorkItemSetFieldCol52 asf3 = new ActionWorkItemSetFieldCol52();
        asf3.setBoundName( "$r" );
        asf3.setFactField( "ResultIntegerField" );
        asf3.setType( SuggestionCompletionEngine.TYPE_NUMERIC );
        asf3.setWorkItemName( "WorkItem" );
        asf3.setWorkItemResultParameterName( "IntegerResult" );
        asf3.setParameterClassName( Integer.class.getName() );
        cols.add( asf3 );

        ActionWorkItemSetFieldCol52 asf4 = new ActionWorkItemSetFieldCol52();
        asf4.setBoundName( "$r" );
        asf4.setFactField( "ResultStringField" );
        asf4.setType( SuggestionCompletionEngine.TYPE_STRING );
        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() );

        List<DTCellValue52> rowData = upgrader.makeDataRowList( row );
        TemplateDataProvider rowDataProvider = new GuidedDTTemplateDataProvider( allColumns,
                                                                                 rowData );

        p.doActions( allColumns,
                     cols,
                     rowDataProvider,
                     rowData,
                     rm );
        assertEquals( 2,
                      rm.rhs.length );

        //Examine RuleModel actions
        ActionExecuteWorkItem aw = (ActionExecuteWorkItem) rm.rhs[0];
        assertNotNull( aw );

        ActionSetField asf = (ActionSetField) rm.rhs[1];
        assertNotNull( asf );

        //Check ActionExecuteWorkItem
        PortableWorkDefinition mpwd = aw.getWorkDefinition();
        assertNotNull( mpwd );

        assertEquals( 4,
                      mpwd.getResults().size() );

        PortableBooleanParameterDefinition mp1 = (PortableBooleanParameterDefinition) mpwd.getResult( "BooleanResult" );
        assertNotNull( mp1 );

        PortableFloatParameterDefinition mp2 = (PortableFloatParameterDefinition) mpwd.getResult( "FloatResult" );
        assertNotNull( mp2 );

        PortableIntegerParameterDefinition mp3 = (PortableIntegerParameterDefinition) mpwd.getResult( "IntegerResult" );
        assertNotNull( mp3 );
View Full Code Here

        PortableBooleanParameterDefinition p1 = new PortableBooleanParameterDefinition();
        p1.setName( "BooleanResult" );
        pwd.addResult( p1 );

        PortableFloatParameterDefinition p2 = new PortableFloatParameterDefinition();
        p2.setName( "FloatResult" );
        pwd.addResult( p2 );

        cols.add( awi );

        ActionWorkItemSetFieldCol52 asf1 = new ActionWorkItemSetFieldCol52();
        asf1.setBoundName( "$r" );
        asf1.setFactField( "ResultBooleanField" );
        asf1.setType( SuggestionCompletionEngine.TYPE_BOOLEAN );
        asf1.setWorkItemName( "WorkItem" );
        asf1.setWorkItemResultParameterName( "BooleanResult" );
        asf1.setParameterClassName( Boolean.class.getName() );
        cols.add( asf1 );

        ActionWorkItemSetFieldCol52 asf2 = new ActionWorkItemSetFieldCol52();
        asf2.setBoundName( "$r" );
        asf2.setFactField( "ResultFloatField" );
        asf2.setType( SuggestionCompletionEngine.TYPE_NUMERIC );
        asf2.setWorkItemName( "WorkItem" );
        asf2.setWorkItemResultParameterName( "FloatResult" );
        asf2.setParameterClassName( Float.class.getName() );
        cols.add( asf2 );

        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() );

        List<DTCellValue52> rowData = upgrader.makeDataRowList( row );
        TemplateDataProvider rowDataProvider = new GuidedDTTemplateDataProvider( allColumns,
                                                                                 rowData );

        p.doActions( allColumns,
                     cols,
                     rowDataProvider,
                     rowData,
                     rm );
        assertEquals( 2,
                      rm.rhs.length );

        //Examine RuleModel actions
        ActionExecuteWorkItem aw = (ActionExecuteWorkItem) rm.rhs[0];
        assertNotNull( aw );

        ActionSetField asf = (ActionSetField) rm.rhs[1];
        assertNotNull( asf );

        //Check ActionExecuteWorkItem
        PortableWorkDefinition mpwd = aw.getWorkDefinition();
        assertNotNull( mpwd );

        assertEquals( 2,
                      mpwd.getResults().size() );

        PortableBooleanParameterDefinition mp1 = (PortableBooleanParameterDefinition) mpwd.getResult( "BooleanResult" );
        assertNotNull( mp1 );

        PortableFloatParameterDefinition mp2 = (PortableFloatParameterDefinition) mpwd.getResult( "FloatResult" );
        assertNotNull( mp2 );

        //Check ActionSetField
        assertEquals( asf.variable,
                      "$r" );
View Full Code Here

        PortableBooleanParameterDefinition p1 = new PortableBooleanParameterDefinition();
        p1.setName( "BooleanResult" );
        pwd.addResult( p1 );

        PortableFloatParameterDefinition p2 = new PortableFloatParameterDefinition();
        p2.setName( "FloatResult" );
        pwd.addResult( p2 );

        PortableIntegerParameterDefinition p3 = new PortableIntegerParameterDefinition();
        p3.setName( "IntegerResult" );
        pwd.addResult( p3 );

        PortableStringParameterDefinition p4 = new PortableStringParameterDefinition();
        p4.setName( "StringResult" );
        pwd.addResult( p4 );

        cols.add( awi );

        ActionWorkItemInsertFactCol52 asf1 = new ActionWorkItemInsertFactCol52();
        asf1.setBoundName( "$r" );
        asf1.setFactField( "ResultBooleanField" );
        asf1.setType( SuggestionCompletionEngine.TYPE_BOOLEAN );
        asf1.setWorkItemName( "WorkItem" );
        asf1.setWorkItemResultParameterName( "BooleanResult" );
        asf1.setParameterClassName( Boolean.class.getName() );
        cols.add( asf1 );

        ActionWorkItemInsertFactCol52 asf2 = new ActionWorkItemInsertFactCol52();
        asf2.setBoundName( "$r" );
        asf2.setFactField( "ResultFloatField" );
        asf2.setType( SuggestionCompletionEngine.TYPE_NUMERIC );
        asf2.setWorkItemName( "WorkItem" );
        asf2.setWorkItemResultParameterName( "FloatResult" );
        asf2.setParameterClassName( Float.class.getName() );
        cols.add( asf2 );

        ActionWorkItemInsertFactCol52 asf3 = new ActionWorkItemInsertFactCol52();
        asf3.setBoundName( "$r" );
        asf3.setFactField( "ResultIntegerField" );
        asf3.setType( SuggestionCompletionEngine.TYPE_NUMERIC );
        asf3.setWorkItemName( "WorkItem" );
        asf3.setWorkItemResultParameterName( "IntegerResult" );
        asf3.setParameterClassName( Integer.class.getName() );
        cols.add( asf3 );

        ActionWorkItemInsertFactCol52 asf4 = new ActionWorkItemInsertFactCol52();
        asf4.setBoundName( "$r" );
        asf4.setFactField( "ResultStringField" );
        asf4.setType( SuggestionCompletionEngine.TYPE_STRING );
        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() );

        List<DTCellValue52> rowData = upgrader.makeDataRowList( row );
        TemplateDataProvider rowDataProvider = new GuidedDTTemplateDataProvider( allColumns,
                                                                                 rowData );

        p.doActions( allColumns,
                     cols,
                     rowDataProvider,
                     rowData,
                     rm );
        assertEquals( 2,
                      rm.rhs.length );

        //Examine RuleModel actions
        ActionExecuteWorkItem aw = (ActionExecuteWorkItem) rm.rhs[0];
        assertNotNull( aw );

        ActionInsertFact aif = (ActionInsertFact) rm.rhs[1];
        assertNotNull( aif );

        //Check ActionExecuteWorkItem
        PortableWorkDefinition mpwd = aw.getWorkDefinition();
        assertNotNull( mpwd );

        assertEquals( 4,
                      mpwd.getResults().size() );

        PortableBooleanParameterDefinition mp1 = (PortableBooleanParameterDefinition) mpwd.getResult( "BooleanResult" );
        assertNotNull( mp1 );

        PortableFloatParameterDefinition mp2 = (PortableFloatParameterDefinition) mpwd.getResult( "FloatResult" );
        assertNotNull( mp2 );

        PortableIntegerParameterDefinition mp3 = (PortableIntegerParameterDefinition) mpwd.getResult( "IntegerResult" );
        assertNotNull( mp3 );
View Full Code Here

        PortableBooleanParameterDefinition p1 = new PortableBooleanParameterDefinition();
        p1.setName( "BooleanResult" );
        pwd.addResult( p1 );

        PortableFloatParameterDefinition p2 = new PortableFloatParameterDefinition();
        p2.setName( "FloatResult" );
        pwd.addResult( p2 );

        cols.add( awi );

        ActionWorkItemInsertFactCol52 asf1 = new ActionWorkItemInsertFactCol52();
        asf1.setBoundName( "$r" );
        asf1.setFactField( "ResultBooleanField" );
        asf1.setType( SuggestionCompletionEngine.TYPE_BOOLEAN );
        asf1.setWorkItemName( "WorkItem" );
        asf1.setWorkItemResultParameterName( "BooleanResult" );
        asf1.setParameterClassName( Boolean.class.getName() );
        cols.add( asf1 );

        ActionWorkItemInsertFactCol52 asf2 = new ActionWorkItemInsertFactCol52();
        asf2.setBoundName( "$r" );
        asf2.setFactField( "ResultFloatField" );
        asf2.setType( SuggestionCompletionEngine.TYPE_NUMERIC );
        asf2.setWorkItemName( "WorkItem" );
        asf2.setWorkItemResultParameterName( "FloatResult" );
        asf2.setParameterClassName( Float.class.getName() );
        cols.add( asf2 );

        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() );

        List<DTCellValue52> rowData = upgrader.makeDataRowList( row );
        TemplateDataProvider rowDataProvider = new GuidedDTTemplateDataProvider( allColumns,
                                                                                 rowData );

        p.doActions( allColumns,
                     cols,
                     rowDataProvider,
                     rowData,
                     rm );
        assertEquals( 2,
                      rm.rhs.length );

        //Examine RuleModel actions
        ActionExecuteWorkItem aw = (ActionExecuteWorkItem) rm.rhs[0];
        assertNotNull( aw );

        ActionInsertFact aif = (ActionInsertFact) rm.rhs[1];
        assertNotNull( aif );

        //Check ActionExecuteWorkItem
        PortableWorkDefinition mpwd = aw.getWorkDefinition();
        assertNotNull( mpwd );

        assertEquals( 2,
                      mpwd.getResults().size() );

        PortableBooleanParameterDefinition mp1 = (PortableBooleanParameterDefinition) mpwd.getResult( "BooleanResult" );
        assertNotNull( mp1 );

        PortableFloatParameterDefinition mp2 = (PortableFloatParameterDefinition) mpwd.getResult( "FloatResult" );
        assertNotNull( mp2 );

        //Check ActionInsertFact
        assertEquals( aif.getBoundName(),
                      "$r" );
View Full Code Here

            DataType pdt = pd.getType();
            PortableParameterDefinition ppd = null;
            if ( pdt instanceof BooleanDataType ) {
                ppd = new PortableBooleanParameterDefinition();
            } else if ( pdt instanceof FloatDataType ) {
                ppd = new PortableFloatParameterDefinition();
            } else if ( pdt instanceof IntegerDataType ) {
                ppd = new PortableIntegerParameterDefinition();
            } else if ( pdt instanceof ListDataType ) {
                //TODO ListDataType
                //ppd = new PortableListParameterDefinition();
View Full Code Here

        PortableBooleanParameterDefinition p1 = new PortableBooleanParameterDefinition();
        p1.setName( "BooleanParameter" );
        p1.setValue( Boolean.TRUE );
        pwd.addParameter( p1 );

        PortableFloatParameterDefinition p2 = new PortableFloatParameterDefinition();
        p2.setName( "FloatParameter" );
        p2.setValue( 123.456f );
        pwd.addParameter( p2 );

        PortableIntegerParameterDefinition p3 = new PortableIntegerParameterDefinition();
        p3.setName( "IntegerParameter" );
        p3.setValue( 123 );
View Full Code Here

        p1.setName( "BooleanParameter" );
        p1.setValue( Boolean.TRUE );
        p1.setBinding( "" );
        pwd.addParameter( p1 );

        PortableFloatParameterDefinition p2 = new PortableFloatParameterDefinition();
        p2.setName( "FloatParameter" );
        p2.setValue( 123.456f );
        p2.setBinding( "" );
        pwd.addParameter( p2 );

        PortableIntegerParameterDefinition p3 = new PortableIntegerParameterDefinition();
        p3.setName( "IntegerParameter" );
        p3.setValue( 123 );
View Full Code Here

        p1.setName( "BooleanParameter" );
        p1.setBinding( "$b" );
        p1.setValue( Boolean.TRUE );
        pwd.addParameter( p1 );

        PortableFloatParameterDefinition p2 = new PortableFloatParameterDefinition();
        p2.setName( "FloatParameter" );
        p2.setBinding( "$f" );
        p2.setValue( 123.456f );
        pwd.addParameter( p2 );

        PortableIntegerParameterDefinition p3 = new PortableIntegerParameterDefinition();
        p3.setName( "IntegerParameter" );
        p3.setBinding( "$i" );
View Full Code Here

TOP

Related Classes of org.drools.ide.common.shared.workitems.PortableFloatParameterDefinition

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.