Package org.drools.base.mvel.MVELCompilationUnit

Examples of org.drools.base.mvel.MVELCompilationUnit.DroolsMVELIndexedFactory


                     Object context,
                     Tuple leftTuple,
                     Declaration[] declarations,
                     WorkingMemory workingMemory) throws Exception {
        Object[] localVars = new Object[initUnit.getOtherIdentifiers().length];
        DroolsMVELIndexedFactory factory = initUnit.getFactory( null, null, null, (LeftTuple) leftTuple, localVars, (InternalWorkingMemory) workingMemory, workingMemory.getGlobalResolver()  );
       
        Package pkg = workingMemory.getRuleBase().getPackage( "MAIN" );
        if ( pkg != null ) {
            MVELDialectRuntimeData data = (MVELDialectRuntimeData) pkg.getDialectRuntimeRegistry().getDialectData( "mvel" );
            factory.setNextFactory( data.getFunctionFactory() );
        }

        MVEL.executeExpression( this.init,
                                null,
                                factory );
       
        if ( localVars.length > 0 ) {
            for ( int i = 0; i < factory.getOtherVarsLength(); i++ ) {
                localVars[i] = factory.getIndexedVariableResolver( factory.getOtherVarsPos() + i ).getValue();
            }
        }
       
        ((MVELAccumulatorContext) context).setVariables( localVars );
    }
View Full Code Here


                           InternalFactHandle handle,
                           Declaration[] declarations,
                           Declaration[] innerDeclarations,
                           WorkingMemory workingMemory) throws Exception {
        Object[]  localVars = ((MVELAccumulatorContext) context).getVariables();
        DroolsMVELIndexedFactory factory = actionUnit.getFactory( null, null, handle.getObject(), (LeftTuple) leftTuple, localVars, (InternalWorkingMemory) workingMemory, workingMemory.getGlobalResolver()  );      

        if ( reverse != null ) {
            // SNAPSHOT variable values
            ((MVELAccumulatorContext) context).getShadow().put( handle.getId(), factory);
        }
        MVEL.executeExpression( this.action,
                                null,
                                factory );
       
        if ( localVars.length > 0 ) {
            for ( int i = 0; i < factory.getOtherVarsLength(); i++ ) {
                localVars[i] = factory.getIndexedVariableResolver( factory.getOtherVarsPos() + i ).getValue();
            }
        }
       
        ((MVELAccumulatorContext) context).setVariables( localVars );       
    }
View Full Code Here

                        InternalFactHandle handle,
                        Declaration[] declarations,
                        Declaration[] innerDeclarations,
                        WorkingMemory workingMemory) throws Exception {
        Object[]  localVars = ((MVELAccumulatorContext) context).getVariables();
        DroolsMVELIndexedFactory factory = ((MVELAccumulatorContext) context).shadow.remove( handle.getId() );
        // we need the latest local vars
        if ( localVars.length > 0 ) {
            for ( int i = 0; i < factory.getOtherVarsLength(); i++ ) {
                factory.getIndexedVariableResolver( factory.getOtherVarsPos() + i ).setValue(localVars[i]);
            }
        }        

        MVEL.executeExpression( this.reverse,
                                null,
                                factory );
       
        if ( localVars.length > 0 ) {
            for ( int i = 0; i < factory.getOtherVarsLength(); i++ ) {
                localVars[i] = factory.getIndexedVariableResolver( factory.getOtherVarsPos() + i ).getValue();
            }
        }
       
        ((MVELAccumulatorContext) context).setVariables( localVars );        
    }
View Full Code Here

TOP

Related Classes of org.drools.base.mvel.MVELCompilationUnit.DroolsMVELIndexedFactory

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.