Package org.mule.mvel2.integration.impl

Examples of org.mule.mvel2.integration.impl.SimpleValueResolver


    public <T> T evaluate(String expression, MuleMessage message, Map<String, Object> vars)
    {
        MVELExpressionLanguageContext context = createExpressionLanguageContext();
        if (vars != null)
        {
            context.setNextFactory(new CachedMapVariableResolverFactory(vars,
                new DelegateVariableResolverFactory(staticContext, new MessageVariableResolverFactory(
                    parserConfiguration, muleContext, message, new DelegateVariableResolverFactory(
                        globalContext, createVariableVariableResolverFactory(message))))));
        }
        else
View Full Code Here


    {
        parserConfig.addImport(String.class);

        MuleBaseVariableResolverFactory resoverFactory = new MVELExpressionLanguageContext(parserConfig,
            muleContext);
        resoverFactory.setNextFactory(new MapVariableResolverFactory(Collections.singletonMap("foo", "val")));

        assertNotNull(resoverFactory.getVariableResolver("foo"));
        assertEquals("val", resoverFactory.getVariableResolver("foo").getValue());
        assertNull(resoverFactory.getVariableResolver("bar"));
    }
View Full Code Here

    @Test
    public void testGetVariableResolver()
    {
        MuleBaseVariableResolverFactory resoverFactory = new MVELExpressionLanguageContext(parserConfig,
            muleContext);
        resoverFactory.addResolver("foo", new SimpleValueResolver("val"));

        assertNotNull(resoverFactory.getVariableResolver("foo"));
        assertEquals("val", resoverFactory.getVariableResolver("foo").getValue());
        assertNull(resoverFactory.getVariableResolver("bar"));
    }
View Full Code Here

  public boolean isResolveable(String name) {
    return workItem.getResult(name) != null;
  }
 
  public VariableResolver getVariableResolver(String name) {
    return new SimpleValueResolver(workItem.getResult(name));
  }
View Full Code Here

 
  public VariableResolver getVariableResolver(String name) {
    Object value = ((VariableScopeInstance)
      nodeInstance.resolveContextInstance(
          VariableScope.VARIABLE_SCOPE, name)).getVariable(name);
    return new SimpleValueResolver(value);
  }
View Full Code Here

    return variableScope.getVariable(name) != null;
  }
 
  public VariableResolver getVariableResolver(String name) {
    Object value = variableScope.getVariable(name);
    return new SimpleValueResolver(value);
  }
View Full Code Here

   
    public void execute(final KnowledgeHelper knowledgeHelper, final WorkingMemory workingMemory, ProcessContext context) throws Exception {
        // must clone to avoid concurrency problems
        DroolsMVELFactory factory = (DroolsMVELFactory) this.prototype.clone();
       
        factory.addResolver("context", new SimpleValueResolver(context));
        factory.addResolver("kcontext", new SimpleValueResolver(context));
        if (variableNames != null) {
          for (String variableName: variableNames) {
            factory.addResolver(
            variableName, new SimpleValueResolver(context.getVariable(variableName)));
          }
        }
       
        factory.setContext( null,
                            knowledgeHelper,
View Full Code Here

    public Object evaluate(final WorkingMemory workingMemory,
                           ProcessContext context) throws Exception {
        DroolsMVELFactory factory = (DroolsMVELFactory) this.prototype.clone();
       
        factory.addResolver("context", new SimpleValueResolver(context));
        factory.addResolver("kcontext", new SimpleValueResolver(context));
        if (variableNames != null) {
          for (String variableName: variableNames) {
            factory.addResolver(
            variableName, new SimpleValueResolver(context.getVariable(variableName)));
          }
        }
       
        factory.setContext( null,
                            null,
View Full Code Here

  public boolean isResolveable(String name) {
    return workItem.getResult(name) != null;
  }
 
  public VariableResolver getVariableResolver(String name) {
    return new SimpleValueResolver(workItem.getResult(name));
  }
View Full Code Here

 
  public VariableResolver getVariableResolver(String name) {
    Object value = ((VariableScopeInstance)
      nodeInstance.resolveContextInstance(
          VariableScope.VARIABLE_SCOPE, name)).getVariable(name);
    return new SimpleValueResolver(value);
  }
View Full Code Here

TOP

Related Classes of org.mule.mvel2.integration.impl.SimpleValueResolver

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.