Package org.drools.rule

Examples of org.drools.rule.MVELDialectRuntimeData


        VariableResolverFactory factory = unit.getFactory( null, null, null, (LeftTuple) tuple, null, (InternalWorkingMemory) workingMemory, workingMemory.getGlobalResolver()  );

        // do we have any functions for this namespace?
        Package pkg = workingMemory.getRuleBase().getPackage( "MAIN" );
        if ( pkg != null ) {
            MVELDialectRuntimeData data = (MVELDialectRuntimeData) pkg.getDialectRuntimeRegistry().getDialectData( this.id );
            factory.setNextFactory( data.getFunctionFactory() );
        }

        final Boolean result = (Boolean) MVEL.executeExpression( this.expr,
                                                                 null,
                                                                 factory );
View Full Code Here


            MVELEvalExpression expr = new MVELEvalExpression( unit,
                                                              dialect.getId() );
            eval.setEvalExpression( expr );

            MVELDialectRuntimeData data = (MVELDialectRuntimeData) context.getPkg().getDialectRuntimeRegistry().getDialectData( "mvel" );
            data.addCompileable( eval,
                                  expr );

            expr.compile( data );
            return eval;
        } catch ( final Exception e ) {
View Full Code Here

        // this.pkg.getDialectRuntimeRegistry().setDialectData( ID,
        // this.data );

        // initialise the dialect runtime data if it doesn't already exist
        if ( pkg.getDialectRuntimeRegistry().getDialectData( getId() ) == null ) {
            data = new MVELDialectRuntimeData();
            this.pkg.getDialectRuntimeRegistry().setDialectData( getId(),
                                                                 data );
            data.onAdd( this.pkg.getDialectRuntimeRegistry(),
                        this.pkgBuilder.getRootClassLoader() );
        } else {
View Full Code Here

            MVELEnabledExpression expr = new MVELEnabledExpression( unit,
                                                                    dialect.getId() );
            context.getRule().setEnabled( expr );

            MVELDialectRuntimeData data = (MVELDialectRuntimeData) context.getPkg().getDialectRuntimeRegistry().getDialectData( "mvel" );
            data.addCompileable( context.getRule(),
                                 expr );

            expr.compile( data );
        } catch ( final Exception e ) {
            context.getErrors().add( new DescrBuildError( context.getParentDescr(),
View Full Code Here

                context.getRule().setConsequence( expr );
            } else {
                context.getRule().getNamedConsequences().put(consequenceName, expr);
            }
           
            MVELDialectRuntimeData data = (MVELDialectRuntimeData) context.getPkg().getDialectRuntimeRegistry().getDialectData( "mvel" );
            data.addCompileable( context.getRule(),
                                 expr );
           
            expr.compile( data );
        } catch ( final Exception e ) {
            context.getErrors().add( new DescrBuildError( context.getParentDescr(),
View Full Code Here

                                                          null,
                                                          null,
                                                          accumulators,
                                                          accumDescr.isMultiFunction() );

            MVELDialectRuntimeData data = (MVELDialectRuntimeData) context.getPkg().getDialectRuntimeRegistry().getDialectData( "mvel" );
            int index = 0;
            for ( Accumulator accumulator : accumulators ) {
                data.addCompileable( accumulate.new Wirer( index++ ),
                                     (MVELCompileable) accumulator );
                ((MVELCompileable) accumulator).compile( data );
            }

            return accumulate;
View Full Code Here

            MVELDataProvider dataProvider = new MVELDataProvider( unit,
                                                                  context.getDialect().getId() );
            from = new From( dataProvider );

            MVELDialectRuntimeData data = (MVELDialectRuntimeData) context.getPkg().getDialectRuntimeRegistry().getDialectData( "mvel" );
            data.addCompileable( from,
                                  dataProvider );
           
            dataProvider.compile( data );
        } catch ( final Exception e ) {
            context.getErrors().add( new DescrBuildError( context.getParentDescr(),
View Full Code Here

   
            MVELReturnValueExpression expr = new MVELReturnValueExpression( unit,
                                                                            context.getDialect().getId() );
            returnValueRestriction.setReturnValueExpression( expr );
           
            MVELDialectRuntimeData data = (MVELDialectRuntimeData) context.getPkg().getDialectRuntimeRegistry().getDialectData( "mvel" );
            data.addCompileable( returnValueRestriction,
                                  expr );
           
            expr.compile( data );
        } catch ( final Exception e ) {
            context.getErrors().add( new DescrBuildError( context.getParentDescr(),
View Full Code Here

        MVELAnalysisResult result = null;
        if ( expr.trim().length() > 0 ) {
            MVEL.COMPILER_OPT_ALLOW_NAKED_METH_CALL = true;
            MVELDialect dialect = (MVELDialect) context.getDialect( "mvel" );
           
            MVELDialectRuntimeData data = ( MVELDialectRuntimeData) context.getPkg().getDialectRuntimeRegistry().getDialectData( "mvel" );
            ParserConfiguration conf = data.getParserConfiguration();

            conf.setClassLoader( context.getPackageBuilder().getRootClassLoader() );

            // first compilation is for verification only
            // @todo proper source file name
View Full Code Here

            MVELPredicateExpression expr = new MVELPredicateExpression( unit,
                                                                        context.getDialect().getId() );
            predicate.setPredicateExpression( expr );

            MVELDialectRuntimeData data = (MVELDialectRuntimeData) context.getPkg().getDialectRuntimeRegistry().getDialectData( "mvel" );
            data.addCompileable( predicate,
                                  expr );

            expr.compile( data );
        } catch ( final Exception e ) {
            context.getErrors().add( new DescrBuildError( context.getParentDescr(),
View Full Code Here

TOP

Related Classes of org.drools.rule.MVELDialectRuntimeData

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.