Examples of MapVariableResolverFactory


Examples of org.mvel2.integration.impl.MapVariableResolverFactory

        context.put( "session",
                     session );

        return (String) TemplateRuntime.execute( REPORT_REGISTRY.getNamedTemplate( ruleTemplate ),
                                                 null,
                                                 new MapVariableResolverFactory( context ),
                                                 REPORT_REGISTRY );
    }
View Full Code Here

Examples of org.mvel2.integration.impl.MapVariableResolverFactory

        public DroolsMVELIndexedFactory(String[] varNames,
                                        Object[] values,
                                        VariableResolverFactory factory) {
            this.indexedVariableNames = varNames;
            this.values = values;
            this.nextFactory = new MapVariableResolverFactory();
            this.nextFactory.setNextFactory( factory );
            this.indexedVariableResolvers = createResolvers( values );
        }
View Full Code Here

Examples of org.mvel2.integration.impl.MapVariableResolverFactory

            VariableResolver vr = getResolver( name );
            if ( vr != null ) {
                vr.setValue( value );
                return vr;
            } else {
                if ( nextFactory == null ) nextFactory = new MapVariableResolverFactory( new HashMap() );
                return nextFactory.createVariable( name,
                                                   value );
            }
        }
View Full Code Here

Examples of org.mvel2.integration.impl.MapVariableResolverFactory

                } else {
                    vr.setValue( value );
                    return vr;
                }
            } else {
                if ( nextFactory == null ) nextFactory = new MapVariableResolverFactory( new HashMap() );
                return nextFactory.createVariable( name,
                                                   value,
                                                   type );
            }
        }
View Full Code Here

Examples of org.mvel2.integration.impl.MapVariableResolverFactory

       
        TemplateRegistry registry = getRuleTemplateRegistry(context.getPackageBuilder().getRootClassLoader());

        context.getMethods().add( TemplateRuntime.execute( registry.getNamedTemplate( ruleTemplate ),
                                                           null,
                                                           new MapVariableResolverFactory( vars ),
                                                           registry ) );

        registry = getInvokerTemplateRegistry(context.getPackageBuilder().getRootClassLoader());
        final String invokerClassName = context.getPkg().getName() + "." + context.getRuleDescr().getClassName() + StringUtils.ucFirst( className ) + "Invoker";

        context.getInvokers().put( invokerClassName,
                                   TemplateRuntime.execute( registry.getNamedTemplate( invokerTemplate ),
                                                            null,
                                                            new MapVariableResolverFactory( vars ),
                                                            registry ) );

        context.getInvokerLookups().put( invokerClassName,
                                             invokerLookup );
        context.getDescrLookups().put( invokerClassName,
View Full Code Here

Examples of org.mvel2.integration.impl.MapVariableResolverFactory

        }

        vars.put( "text",
                  functionDescr.getText() );

        final String text = String.valueOf(TemplateRuntime.eval( template, null, new MapVariableResolverFactory(vars)));

        final BufferedReader reader = new BufferedReader( new StringReader( text ) );
        String line = null;
        final String lineStartsWith = "    public static " + functionDescr.getReturnType() + " " + functionDescr.getName();
        int offset = 0;
View Full Code Here

Examples of org.mvel2.integration.impl.MapVariableResolverFactory

            for ( Object o : map.get( "locations" ).values() ) {
                ksession.insert( o );
            }

            MapVariableResolverFactory f = new MapVariableResolverFactory( map );

            String baseStr = "import  org.drools.adventures.*;  import org.drools.adventures.commands.*;\n";
            FactHandle fh = ksession.insert( MVEL.eval( baseStr + "new EnterEvent( characters['hero'], rooms['first floor hallway'] )",
                                                        f ) );
            ksession.fireAllRules();
View Full Code Here

Examples of org.mvel2.integration.impl.MapVariableResolverFactory

        try {
            Thread.currentThread().setContextClassLoader( classLoader );
            Map vars = new HashMap();
            vars.put( "args",
                      cmd );
            MapVariableResolverFactory f = new MapVariableResolverFactory( vars );
            Action c = (Action) cmd.get( 0 );
            switch ( c ) {
                case MOVE : {
                    ksession.insert( new Request( session,
                                                  MVEL.eval( baseStr + "new MoveCommand(args[1], args[2])",
View Full Code Here

Examples of org.mvel2.integration.impl.MapVariableResolverFactory

        TemplateRegistry registry = getRuleTemplateRegistry();

        Object method = TemplateRuntime.execute( registry.getNamedTemplate( "accumulateInnerClass" ),
                                                 null,
                                                 new MapVariableResolverFactory( map ),
                                                 registry );

        //System.out.println( method );
    }
View Full Code Here

Examples of org.mvel2.integration.impl.MapVariableResolverFactory

                 Boolean.FALSE );

        TemplateRegistry registry = getInvokerTemplateRegistry();
        Object method = TemplateRuntime.execute( registry.getNamedTemplate( "accumulateInvoker" ),
                                                 null,
                                                 new MapVariableResolverFactory( map ),
                                                 registry );

        //System.out.println( method );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.