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

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


        }

        public DSLVariableValue getSelectedValue() {
            int selectedIndex = resultWidget.getSelectedIndex();
            if ( selectedIndex != -1 ) {
                return new DSLVariableValue(resultWidget.getValue( selectedIndex ));
            } else {
                return new DSLVariableValue("");
            }
        }
View Full Code Here


            initWidget( hp );
        }

        public DSLVariableValue getSelectedValue() {
            String value = this.resultWidget.getSelectedIndex() == 0 ? "true" : "false";
            return new DSLVariableValue(value);
        }
View Full Code Here

            hp.add( new HTML( " " ) );
            initWidget( hp );
        }

        public DSLVariableValue getSelectedValue() {
            return new DSLVariableValue(resultWidget.getDateString());
        }
View Full Code Here

        }
        return clone;
    }

    private DSLVariableValue visitDSLVariableValue(DSLVariableValue value) {
        DSLVariableValue clone = new DSLVariableValue();
        clone.setValue( value.getValue() );
        return clone;
    }
View Full Code Here

                                collection );
        if ( item instanceof DSLVariableValue ) {
            target.add( item );
        } else if ( item instanceof String ) {
            //The only other possible legacy type is a String, so using toString() should be OK
            DSLVariableValue value = new DSLVariableValue( item.toString() );
            target.add( value );
        }
    }
View Full Code Here

    @Test
    public void testInterpolate1() {
        final DSLSentence sen = new DSLSentence();
        sen.setDefinition( "{something} here" );
        sen.getValues().set( 0, new DSLVariableValue("word"));
        assertEquals( "word here",
                      sen.interpolate() );
    }
View Full Code Here

    @Test
    public void testInterpolate2() {
        final DSLSentence sen = new DSLSentence();
        sen.setDefinition( "a {here}" );
        sen.getValues().set( 0, new DSLVariableValue("word"));
        assertEquals( "a word",
                      sen.interpolate() );
    }
View Full Code Here

    @Test
    public void testInterpolate3() {
        final DSLSentence sen = new DSLSentence();
        sen.setDefinition( "a {here} and {here}" );
        sen.getValues().set( 0, new DSLVariableValue("word"));
        sen.getValues().set( 1, new DSLVariableValue("word") );
        assertEquals( "a word and word",
                      sen.interpolate() );
    }
View Full Code Here

    @Test
    public void testEnumSentenceContainingRegEx() {
        final DSLSentence sen = new DSLSentence();
        sen.setDefinition( "When a person exists with social security number \"{chooseSSN:\\d{3}-\\d{2}-\\d{4}}\"" );
        sen.getValues().set( 0, new DSLVariableValue("333-22-4444"));
        assertEquals( "When a person exists with social security number \"333-22-4444\"",
                      sen.interpolate() );
    }
View Full Code Here

    @Test
    public void testEnumSentenceWithBoolean() {
        final DSLSentence sen = new DSLSentence();
        sen.setDefinition( "When a person is alive {alive:BOOLEAN:checked}" );
        sen.getValues().set( 0, new DSLVariableValue("true" ));
        assertEquals( "When a person is alive true",
                      sen.interpolate() );
    }
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.brl.DSLVariableValue

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.