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

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


                } else if ( sender == fromAccumulateBtn ) {
                    getFromCollectPattern().setRightPattern( new FromAccumulateCompositeFactPattern() );
                } else if ( sender == fromCollectBtn ) {
                    getFromCollectPattern().setRightPattern( new FromCollectCompositeFactPattern() );
                } else if ( sender == freeFormDRLBtn ) {
                    getFromCollectPattern().setRightPattern( new FreeFormLine() );
                } else {
                    throw new IllegalArgumentException( "Unknown sender: " + sender );
                }
                setModified( true );
                getModeller().refreshWidget();
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

    private void addLiteralColumn(GuidedDecisionTable52 dtable,
                                  LiteralValueBuilder vb,
                                  int index) {
        //Create column - Everything is a BRL fragment (for now)
        BRLConditionColumn column = new BRLConditionColumn();
        FreeFormLine ffl = new FreeFormLine();
        ffl.text = vb.getTemplate();
        column.getDefinition().add( ffl );
        BRLConditionVariableColumn parameterColumn = new BRLConditionVariableColumn( "",
                                                                                     SuggestionCompletionEngine.TYPE_BOOLEAN );
        column.getChildColumns().add( parameterColumn );
View Full Code Here

    private void addBRLFragmentColumn(GuidedDecisionTable52 dtable,
                                      ParameterizedValueBuilder vb,
                                      int index) {
        //Create column - Everything is a BRL fragment (for now)
        BRLConditionColumn column = new BRLConditionColumn();
        FreeFormLine ffl = new FreeFormLine();
        ffl.text = vb.getTemplate();
        column.getDefinition().add( ffl );

        for ( String parameter : vb.getParameters() ) {
            BRLConditionVariableColumn parameterColumn = new BRLConditionVariableColumn( parameter,
View Full Code Here

        //Create column - Everything is a BRL fragment (for now)
        BRLConditionColumn column = new BRLConditionColumn();
        dtable.getConditions().add( column );

        FreeFormLine ffl = new FreeFormLine();
        column.getDefinition().add( ffl );

        //DRL prefix
        StringBuffer drl = new StringBuffer();
        drl.append( this.colDefPrefix );
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

    private void addLiteralColumn(GuidedDecisionTable52 dtable,
                                  LiteralValueBuilder vb,
                                  int index) {
        //Create column - Everything is a BRL fragment (for now)
        BRLActionColumn column = new BRLActionColumn();
        FreeFormLine ffl = new FreeFormLine();
        ffl.text = vb.getTemplate();
        column.getDefinition().add( ffl );
        BRLActionVariableColumn parameterColumn = new BRLActionVariableColumn( "",
                                                                               SuggestionCompletionEngine.TYPE_BOOLEAN );
        column.getChildColumns().add( parameterColumn );
View Full Code Here

    private void addBRLFragmentColumn(GuidedDecisionTable52 dtable,
                                      ParameterizedValueBuilder vb,
                                      int index) {
        //Create column - Everything is a BRL fragment (for now)
        BRLActionColumn column = new BRLActionColumn();
        FreeFormLine ffl = new FreeFormLine();
        ffl.text = vb.getTemplate();
        column.getDefinition().add( ffl );

        for ( String parameter : vb.getParameters() ) {
            BRLActionVariableColumn parameterColumn = new BRLActionVariableColumn( parameter,
View Full Code Here

        List<IAction> actionCol0definition = actionCol0.getDefinition();
        assertEquals( 1,
                      actionCol0definition.size() );
        assertTrue( actionCol0definition.get( 0 ) instanceof FreeFormLine );

        FreeFormLine actionCol0ffl = (FreeFormLine) actionCol0definition.get( 0 );
        assertEquals( "policy.setBasePrice(@{param1}, @{param2});",
                      actionCol0ffl.text );

        //Column 1 - Variable 1
        BRLActionVariableColumn actionCol0param0 = actionCol0.getChildColumns().get( 0 );
        assertEquals( "param1",
                      actionCol0param0.getVarName() );
        assertEquals( "Multi-parameters",
                      actionCol0param0.getHeader() );
        assertEquals( SuggestionCompletionEngine.TYPE_OBJECT,
                      actionCol0param0.getFieldType() );
        assertNull( actionCol0param0.getFactType() );
        assertNull( actionCol0param0.getFactField() );

        //Column 1 - Variable 2
        BRLActionVariableColumn actionCol0param1 = actionCol0.getChildColumns().get( 1 );
        assertEquals( "param2",
                      actionCol0param1.getVarName() );
        assertEquals( "Multi-parameters",
                      actionCol0param1.getHeader() );
        assertEquals( SuggestionCompletionEngine.TYPE_OBJECT,
                      actionCol0param1.getFieldType() );
        assertNull( actionCol0param1.getFactType() );
        assertNull( actionCol0param1.getFactField() );

        //Column 2
        BRLActionColumn actionCol1 = ((BRLActionColumn) dtable.getActionCols().get( 1 ));
        assertEquals( "Single-parameter",
                      actionCol1.getHeader() );
        assertEquals( 1,
                      actionCol1.getChildColumns().size() );

        List<IAction> actionCol1definition = actionCol1.getDefinition();
        assertEquals( 1,
                      actionCol1definition.size() );
        assertTrue( actionCol1definition.get( 0 ) instanceof FreeFormLine );

        FreeFormLine actionCol1ffl = (FreeFormLine) actionCol1definition.get( 0 );
        assertEquals( "policy.setSmurf(@{param3});",
                      actionCol1ffl.text );

        //Column 2 - Variable 1
        BRLActionVariableColumn actionCol1param0 = actionCol1.getChildColumns().get( 0 );
        assertEquals( "param3",
                      actionCol1param0.getVarName() );
        assertEquals( "Single-parameter",
                      actionCol1param0.getHeader() );
        assertEquals( SuggestionCompletionEngine.TYPE_OBJECT,
                      actionCol1param0.getFieldType() );
        assertNull( actionCol1param0.getFactType() );
        assertNull( actionCol1param0.getFactField() );

        //Column 3
        BRLActionColumn actionCol2 = ((BRLActionColumn) dtable.getActionCols().get( 2 ));
        assertEquals( "Log-single-parameter",
                      actionCol2.getHeader() );
        assertEquals( 1,
                      actionCol2.getChildColumns().size() );

        List<IAction> actionCol2definition = actionCol2.getDefinition();
        assertEquals( 1,
                      actionCol2definition.size() );
        assertTrue( actionCol2definition.get( 0 ) instanceof FreeFormLine );

        FreeFormLine actionCol2ffl = (FreeFormLine) actionCol2definition.get( 0 );
        assertEquals( "System.out.println(\"@{param4}\");",
                      actionCol2ffl.text );

        //Column 3 - Variable 1
        BRLActionVariableColumn actionCol2param0 = actionCol2.getChildColumns().get( 0 );
        assertEquals( "param4",
                      actionCol2param0.getVarName() );
        assertEquals( "Log-single-parameter",
                      actionCol2param0.getHeader() );
        assertEquals( SuggestionCompletionEngine.TYPE_OBJECT,
                      actionCol2param0.getFieldType() );
        assertNull( actionCol2param0.getFactType() );
        assertNull( actionCol2param0.getFactField() );

        //Column 4
        BRLActionColumn actionCol3 = ((BRLActionColumn) dtable.getActionCols().get( 3 ));
        assertEquals( "Zero-parameters",
                      actionCol3.getHeader() );
        assertEquals( 1,
                      actionCol3.getChildColumns().size() );

        List<IAction> actionCol3definition = actionCol3.getDefinition();
        assertEquals( 1,
                      actionCol3definition.size() );
        assertTrue( actionCol3definition.get( 0 ) instanceof FreeFormLine );

        FreeFormLine actionCol3ffl = (FreeFormLine) actionCol3definition.get( 0 );
        assertEquals( "System.out.println(\"Woot\");",
                      actionCol3ffl.text );

        //Column 3 - Variable 1
        BRLActionVariableColumn actionCol3param0 = actionCol3.getChildColumns().get( 0 );
View Full Code Here

        List<IPattern> conditionCol0definition = conditionCol0.getDefinition();
        assertEquals( 1,
                      conditionCol0definition.size() );
        assertTrue( conditionCol0definition.get( 0 ) instanceof FreeFormLine );

        FreeFormLine conditionCol0ffl = (FreeFormLine) conditionCol0definition.get( 0 );
        assertEquals( "Driver(age > \"@{param1}\", firstName == \"@{param2}\", surname == \"@{param3}\")",
                      conditionCol0ffl.text );

        //Column 1 - Variable 1
        BRLConditionVariableColumn conditionCol0param0 = conditionCol0.getChildColumns().get( 0 );
        assertEquals( "param1",
                      conditionCol0param0.getVarName() );
        assertEquals( "Converted from cell [C4]",
                      conditionCol0param0.getHeader() );
        assertEquals( SuggestionCompletionEngine.TYPE_OBJECT,
                      conditionCol0param0.getFieldType() );
        assertNull( conditionCol0param0.getFactType() );
        assertNull( conditionCol0param0.getFactField() );

        //Column 1 - Variable 2
        BRLConditionVariableColumn conditionCol0param1 = conditionCol0.getChildColumns().get( 1 );
        assertEquals( "param2",
                      conditionCol0param1.getVarName() );
        assertEquals( "Converted from cell [C4]",
                      conditionCol0param1.getHeader() );
        assertEquals( SuggestionCompletionEngine.TYPE_OBJECT,
                      conditionCol0param1.getFieldType() );
        assertNull( conditionCol0param1.getFactType() );
        assertNull( conditionCol0param1.getFactField() );

        //Column 1 - Variable 3
        BRLConditionVariableColumn conditionCol0param2 = conditionCol0.getChildColumns().get( 2 );
        assertEquals( "param3",
                      conditionCol0param2.getVarName() );
        assertEquals( "Converted from cell [C4]",
                      conditionCol0param2.getHeader() );
        assertEquals( SuggestionCompletionEngine.TYPE_OBJECT,
                      conditionCol0param2.getFieldType() );
        assertNull( conditionCol0param2.getFactType() );
        assertNull( conditionCol0param2.getFactField() );

        //Column 2
        BRLConditionColumn conditionCol1 = ((BRLConditionColumn) dtable.getConditions().get( 1 ));
        assertEquals( "something",
                      conditionCol1.getHeader() );
        assertEquals( 2,
                      conditionCol1.getChildColumns().size() );

        List<IPattern> conditionCol1definition = conditionCol1.getDefinition();
        assertEquals( 1,
                      conditionCol1definition.size() );
        assertTrue( conditionCol1definition.get( 0 ) instanceof FreeFormLine );

        FreeFormLine conditionCol1ffl = (FreeFormLine) conditionCol1definition.get( 0 );
        assertEquals( "Vehicle(make == \"@{param4}\", model == \"@{param5}\")",
                      conditionCol1ffl.text );

        //Column 2 - Variable 1
        BRLConditionVariableColumn conditionCol1param0 = conditionCol1.getChildColumns().get( 0 );
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.brl.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.