Package org.drools.core.rule

Examples of org.drools.core.rule.MVELDialectRuntimeData


        VariableResolverFactory factory = factoryContext.getInitFactory();
        initUnit.updateFactory( null, null, null, (LeftTuple) leftTuple, localVars, (InternalWorkingMemory) workingMemory, workingMemory.getGlobalResolver(), factory  );

        InternalKnowledgePackage pkg = workingMemory.getKnowledgeBase().getPackage( "MAIN" );
        if ( pkg != null ) {
            MVELDialectRuntimeData data = (MVELDialectRuntimeData) pkg.getDialectRuntimeRegistry().getDialectData( "mvel" );
            factory.setNextFactory( data.getFunctionFactory() );
        }

        MVELSafeHelper.getEvaluator().executeExpression( this.init,
                                null,
                                factory );
View Full Code Here


                            factory );

        // do we have any functions for this namespace?
        InternalKnowledgePackage pkg = workingMemory.getKnowledgeBase().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

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


        return workingMemory.getKnowledgeBase().getConfiguration().getComponentFactory().getFieldFactory().getFieldValue( MVELSafeHelper.getEvaluator().executeExpression( this.expr,
                                                                                               handle,
View Full Code Here

                                                           rule, null, (LeftTuple) tuple, null, (InternalWorkingMemory) workingMemory, workingMemory.getGlobalResolver()  );

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

        return ((Boolean) MVEL.executeExpression( this.expr,
                                                  null,
                                                  factory )).booleanValue();
View Full Code Here

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

        Object value = MVEL.executeExpression( this.expr, factory );
        if (value instanceof String) {
            value = TimeUtils.parseTimeString( (String)value );
View Full Code Here

                                                           rule, null, leftTuple, null, wm, wm.getGlobalResolver() );
       
        // do we have any functions for this namespace?
        InternalKnowledgePackage pkg = wm.getKnowledgeBase().getPackage( "MAIN" );
        if ( pkg != null ) {
            MVELDialectRuntimeData data = (MVELDialectRuntimeData) pkg.getDialectRuntimeRegistry().getDialectData( this.id );
            factory.setNextFactory( data.getFunctionFactory() );
        }

        return MVELSafeHelper.getEvaluator().executeExpression(this.expr,
                                      factory);
    }
View Full Code Here

                            factory );

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

        final Boolean result = (Boolean) MVELSafeHelper.getEvaluator().executeExpression( this.expr,
                                                                 handle,
                                                                 factory );
View Full Code Here

        return conditionEvaluator.evaluate(handle, workingMemory, leftTuple);
    }

    protected void createMvelConditionEvaluator(InternalWorkingMemory workingMemory) {
        if (compilationUnit != null) {
            MVELDialectRuntimeData data = getMVELDialectRuntimeData(workingMemory);
            ExecutableStatement statement = (ExecutableStatement)compilationUnit.getCompiledExpression(data);
            ParserConfiguration configuration = statement instanceof CompiledExpression ?
                    ((CompiledExpression)statement).getParserConfiguration() :
                    data.getParserConfiguration();
            conditionEvaluator = new MvelConditionEvaluator(compilationUnit, configuration, statement, declarations, getAccessedClass());
        } else {
            conditionEvaluator = new MvelConditionEvaluator(getParserConfiguration(workingMemory), expression, declarations, getAccessedClass());
        }
    }
View Full Code Here

        extractor = ( MVELObjectClassFieldReader ) store.getMVELReaderPerson.class.getPackage().getName(),
                                                                         Person.class.getName(),
                                                                         "addresses['home'].street",
                                                                         true,
                                                                         String.class );
        MVELDialectRuntimeData data = new MVELDialectRuntimeData();
        data.addImport( Person.class.getSimpleName(), Person.class );
        data.onAdd( null, ClassLoaderUtil.getClassLoader( null, getClass(), false ) );
       
        extractor.compile( data );
       
       
        person[0] = new Person( "bob",
View Full Code Here

            MVELObjectClassFieldReader nullExtractor =  ( MVELObjectClassFieldReader ) store.getMVELReaderPerson.class.getPackage().getName(),
                                                                                                             Person.class.getName(),
                                                                                                             "addresses['business'].phone",
                                                                                                             true,
                                                                                                             String.class );
            MVELDialectRuntimeData data = new MVELDialectRuntimeData();
            data.addImport( Person.class.getSimpleName(), Person.class );
            data.onAdd( null, ClassLoaderUtil.getClassLoader( null, getClass(), false ) );
           
            nullExtractor.compile( data );           
//
//            InternalReadAccessor nullExtractor = store.getReader( Person.class,
//                                                                  "addresses['business'].phone",
View Full Code Here

TOP

Related Classes of org.drools.core.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.