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

Examples of org.drools.workbench.models.datamodel.rule.FreeFormLine


    @Test
    public void testFreeFormLineFirstValue() {
        TemplateModel m = new TemplateModel();
        m.name = "r1";

        FreeFormLine ffl = new FreeFormLine();
        ffl.setText( "Person( field1 == \"@{f1}\", field2 == \"@{f2}\" )" );
        m.addLhsItem( ffl );

        String expected = "rule \"r1_0\"\n"
                + "dialect \"mvel\"\n"
                + "when\n"
View Full Code Here


    @Test
    public void testFreeFormLineSecondValue() {
        TemplateModel m = new TemplateModel();
        m.name = "r1";

        FreeFormLine ffl = new FreeFormLine();
        ffl.setText( "Person( field1 == \"@{f1}\", field2 == \"@{f2}\" )" );
        m.addLhsItem( ffl );

        String expected = "rule \"r1_0\"\n"
                + "dialect \"mvel\"\n"
                + "when\n"
View Full Code Here

    @Test
    public void testActionFreeFormLineBothValues() {
        TemplateModel m = new TemplateModel();
        m.name = "r1";

        FreeFormLine ffl = new FreeFormLine();
        ffl.setText( "System.println( \"@{f1}\" + \"@{f2}\" );" );
        m.addRhsItem( ffl );

        String expected = "rule \"r1_0\"\n"
                + "dialect \"mvel\"\n"
                + "when\n"
View Full Code Here

    @Test
    public void testActionFreeFormLineFirstValue() {
        TemplateModel m = new TemplateModel();
        m.name = "r1";

        FreeFormLine ffl = new FreeFormLine();
        ffl.setText( "System.println( \"@{f1}\" + \"@{f2}\" );" );
        m.addRhsItem( ffl );

        String expected = "rule \"r1_0\"\n"
                + "dialect \"mvel\"\n"
                + "when\n"
View Full Code Here

    @Test
    public void testActionFreeFormLineSecondValue() {
        TemplateModel m = new TemplateModel();
        m.name = "r1";

        FreeFormLine ffl = new FreeFormLine();
        ffl.setText( "System.println( \"@{f1}\" + \"@{f2}\" );" );
        m.addRhsItem( ffl );

        String expected = "rule \"r1_0\"\n"
                + "dialect \"mvel\"\n"
                + "when\n"
View Full Code Here

    public void testEmptyFreeForm() {
        //https://bugzilla.redhat.com/show_bug.cgi?id=1058247
        TemplateModel m = new TemplateModel();
        m.name = "Empty FreeFormLine";

        FreeFormLine fl = new FreeFormLine();
        m.addLhsItem( fl );

        FactPattern fp = new FactPattern( "Person" );
        fp.setBoundName( "$p" );
        SingleFieldConstraint sfc1 = new SingleFieldConstraint();
        sfc1.setFieldName( "field1" );
        sfc1.setFieldType( DataType.TYPE_STRING );
        sfc1.setConstraintValueType( SingleFieldConstraint.TYPE_TEMPLATE );
        sfc1.setValue( "$f1" );
        sfc1.setOperator( "==" );
        fp.addConstraint( sfc1 );
        m.addLhsItem( fp );

        FreeFormLine fr = new FreeFormLine();
        m.addRhsItem( fr );

        ActionSetField asf = new ActionSetField( "$p" );
        ActionFieldValue afv0 = new ActionFieldValue();
        afv0.setNature( FieldNatureType.TYPE_TEMPLATE );
View Full Code Here

                             "FF" );
            cmds.put( "FF",
                      new Command() {

                          public void execute() {
                              model.addRhsItem( new FreeFormLine(),
                                                Integer.parseInt( positionCbo.getValue( positionCbo.getSelectedIndex() ) ) );
                              hide();
                          }
                      } );
View Full Code Here

                             "FF" );
            cmds.put( "FF",
                      new Command() {

                          public void execute() {
                              model.addLhsItem( new FreeFormLine(),
                                                Integer.parseInt( positionCbo.getValue( positionCbo.getSelectedIndex() ) ) );
                              hide();
                          }
                      } );
View Full Code Here

                         "FF" );
        cmds.put( "FF",
                  new Command() {

                      public void execute() {
                          model.addLhsItem( new FreeFormLine(),
                                            Integer.parseInt( positionCbo.getValue( positionCbo.getSelectedIndex() ) ) );
                          hide();
                      }
                  } );
    }
View Full Code Here

                         "FF" );
        cmds.put( "FF",
                  new Command() {

                      public void execute() {
                          model.addRhsItem( new FreeFormLine(),
                                            Integer.parseInt( positionCbo.getValue( positionCbo.getSelectedIndex() ) ) );
                          hide();
                      }
                  } );
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.datamodel.rule.FreeFormLine

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.