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

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


                        factsType.put( split[ 1 ], split[ 0 ] );
                        addFreeFormLine &= !isInsertedFact( lines, lineCounter, split[ 1 ] );
                    }
                }
                if ( addFreeFormLine ) {
                    FreeFormLine ffl = new FreeFormLine();
                    ffl.setText( line );
                    m.addRhsItem( ffl );
                }
            }
        }
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

                        factsType.put( split[1], split[0] );
                        addFreeFormLine &= !isInsertedFact(lines, lineCounter, split[1]);
                    }
                }
                if ( addFreeFormLine ) {
                    FreeFormLine ffl = new FreeFormLine();
                    ffl.setText( line );
                    m.addRhsItem( ffl );
                }
            }
        }
View Full Code Here

            if ( pattern.getRightPattern() instanceof FreeFormLine ) {
                // this allows MVEL to skip the collect, if any vars are empty
                // note this actually duplicates another inner check for the FFL itself
                // @TODO the FFL should get a reference to the parent, so it can avoid this duplication.
                final FreeFormLine ffl = (FreeFormLine) pattern.getRightPattern();
                if ( ffl.getText() == null ) {
                    return;
                }
                final Matcher matcherTemplateKey = patternTemplateKey.matcher( ffl.getText() );
                boolean found = matcherTemplateKey.find();
                if ( found ) {
                    buf.append( "@if{" );
                    boolean addAnd = false;
                    while ( found ) {
View Full Code Here

    private int parseFreeForm( final RuleModel m,
                               final 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

                                   andDescr.getDescrs().get( 0 ),
                                   isJavaDialect,
                                   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( m,
                                                 (ConditionalElementDescr) descr,
                                                 isJavaDialect,
View Full Code Here

                                                            lineCounter,
                                                            split[ 1 ] );
                    }
                }
                if ( addFreeFormLine ) {
                    FreeFormLine ffl = new FreeFormLine();
                    ffl.setText( line );
                    m.addRhsItem( ffl );
                }
            }
        }
View Full Code Here

            assertEquals( 2,
                          m.rhs.length );

            assertTrue( m.rhs[ 0 ] instanceof FreeFormLine );
            FreeFormLine ffl = (FreeFormLine) m.rhs[ 0 ];
            assertEquals( "DateTime newStartDate = new DateTime();",
                          ffl.getText() );

            assertTrue( m.rhs[ 1 ] instanceof ActionUpdateField );
            ActionUpdateField auf = (ActionUpdateField) m.rhs[ 1 ];
            assertEquals( "$bundle",
                          auf.getVariable() );
View Full Code Here

            assertEquals( 2,
                          m.rhs.length );

            assertTrue( m.rhs[ 0 ] instanceof FreeFormLine );
            FreeFormLine ffl = (FreeFormLine) m.rhs[ 0 ];
            assertEquals( "java.util.Date newStartDate = new java.util.Date();",
                          ffl.getText() );

            assertTrue( m.rhs[ 1 ] instanceof ActionUpdateField );
            ActionUpdateField auf = (ActionUpdateField) m.rhs[ 1 ];
            assertEquals( "$a",
                          auf.getVariable() );
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.