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

Examples of org.drools.workbench.models.datamodel.rule.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 if ( sender == fromEntryPointBtn ) {
                    getFromCollectPattern().setRightPattern( new FromEntryPointFactPattern() );
                } else {
                    throw new IllegalArgumentException( "Unknown sender: " + sender );
                }
View Full Code Here


        RuleModel m = new RuleModel();
        m.name = "with composite";
        m.lhs = new IPattern[ 1 ];
        m.rhs = new IAction[ 1 ];

        FreeFormLine fl = new FreeFormLine();
        fl.setText( "Person()" );
        m.lhs[ 0 ] = fl;

        FreeFormLine fr = new FreeFormLine();
        fr.setText( "fun()" );
        m.rhs[ 0 ] = fr;

        String drl = ruleModelPersistence.marshal( m );
        assertNotNull( drl );
        assertTrue( drl.indexOf( "Person()" ) > 0 );
View Full Code Here

        assertEquals( "Applicant",
                      fp1.getFactType() );

        //Condition line 2
        assertTrue( m.lhs[ 1 ] instanceof FreeFormLine );
        final FreeFormLine ffl = (FreeFormLine) m.lhs[ 1 ];
        assertEquals( "Here's something typed by the user as free-format DRL",
                      ffl.getText() );

        //Condition line 3
        assertTrue( m.lhs[ 2 ] instanceof FactPattern );
        final FactPattern fp2 = (FactPattern) m.lhs[ 2 ];
        assertEquals( "$b",
View Full Code Here

        //RHS
        assertEquals( 2,
                      m.rhs.length );

        assertTrue( m.rhs[ 0 ] instanceof FreeFormLine );
        final FreeFormLine ffl = (FreeFormLine) m.rhs[ 0 ];
        assertEquals( "Here's something typed by the user as free-format DRL",
                      ffl.getText() );

        assertTrue( m.rhs[ 1 ] instanceof ActionSetField );
        final ActionSetField a1 = (ActionSetField) m.rhs[ 1 ];
        assertEquals( "$a",
                      a1.getVariable() );
View Full Code Here

        RuleModel m = new RuleModel();
        m.name = "with composite";
        m.lhs = new IPattern[ 1 ];
        m.rhs = new IAction[ 1 ];

        FreeFormLine fl = new FreeFormLine();
        fl.setText( "Person()" );
        m.lhs[ 0 ] = fl;

        FreeFormLine fr = new FreeFormLine();
        fr.setText( "fun()" );
        m.rhs[ 0 ] = fr;

        String drl = RuleModelDRLPersistenceImpl.getInstance().marshal( m );
        assertNotNull( drl );
View Full Code Here

        RuleModel m = new RuleModel();
        m.name = "Empty FreeFormLine";
        m.lhs = new IPattern[ 1 ];
        m.rhs = new IAction[ 1 ];

        FreeFormLine fl = new FreeFormLine();
        m.lhs[ 0 ] = fl;

        FreeFormLine fr = new FreeFormLine();
        m.rhs[ 0 ] = fr;

        String drl = ruleModelPersistence.marshal( m );
        assertNotNull( drl );
    }
View Full Code Here

        }
        return clone;
    }

    private FreeFormLine visitFreeFormLine( FreeFormLine ffl ) {
        FreeFormLine clone = new FreeFormLine();
        clone.setText( ffl.getText() );
        return clone;
    }
View Full Code Here

    private int parseFreeForm( RuleModel m,
                               ExpandedDRLInfo expandedDRLInfo,
                               int lineCounter ) {
        String freeForm = expandedDRLInfo.freeFormStatementsInLhs.get( lineCounter );
        while ( freeForm != null ) {
            FreeFormLine ffl = new FreeFormLine();
            ffl.setText( freeForm );
            m.addLhsItem( ffl );
            freeForm = expandedDRLInfo.freeFormStatementsInLhs.get( ++lineCounter );
        }
        return lineCounter;
    }
View Full Code Here

            return parsePatternDescr( (PatternDescr) descr, boundParams, dmo );
        } else if ( descr instanceof AndDescr ) {
            AndDescr andDescr = (AndDescr) descr;
            return parseBaseDescr( andDescr.getDescrs().get( 0 ), boundParams, dmo );
        } else if ( descr instanceof EvalDescr ) {
            FreeFormLine freeFormLine = new FreeFormLine();
            freeFormLine.setText( "eval( " + ( (EvalDescr) descr ).getContent() + " )" );
            return freeFormLine;
        } else if ( descr instanceof ConditionalElementDescr ) {
            return parseExistentialElementDescr( (ConditionalElementDescr) descr, boundParams, dmo );
        }
        return null;
View Full Code Here

                    String[] split = field.split( " " );
                    if ( split.length == 2 ) {
                        factsType.put( split[ 1 ], split[ 0 ] );
                    }
                } else if ( line.trim().length() > 0 ) {
                    FreeFormLine ffl = new FreeFormLine();
                    ffl.setText( line );
                    m.addRhsItem( ffl );
                }
            }
        }
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.