Examples of ExpressionManager


Examples of org.camunda.bpm.engine.impl.el.ExpressionManager

    String type = Expression.class.getName();

    Object value = getFixedValue(field);

    if (value == null) {
      ExpressionManager expressionManager = context.getExpressionManager();
      value = getExpressionValue(field, expressionManager);
    }

    return new FieldDeclaration(name, type, value);
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.el.ExpressionManager

    }
  }

  protected void initExpressionManager() {
    if (expressionManager==null) {
      expressionManager = new ExpressionManager(beans);
      // add function mapper for command context (eg currentUser(), currentUserGroups())
      expressionManager.addFunctionMapper(new CommandContextFunctionMapper());
      // add function mapper for date time (eg now(), dateTime())
      expressionManager.addFunctionMapper(new DateTimeFunctionMapper());
    }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.el.ExpressionManager

    if (conditions.size() > 1) {
      String id = sentryDeclaration.getId();
      LOGGER.info("The ifPart of Sentry with id '"+id+"' has more than one condition: only the first condition will be used, the other conditions will be ignored.");
    }

    ExpressionManager expressionManager = context.getExpressionManager();
    ConditionExpression condition = conditions.iterator().next();
    Expression conditionExpression = expressionManager.createExpression(condition.getBody());

    CmmnIfPartDeclaration ifPartDeclaration = new CmmnIfPartDeclaration();
    ifPartDeclaration.setCondition(conditionExpression);
    sentryDeclaration.setIfPart(ifPartDeclaration);
  }
View Full Code Here

Examples of org.mule.api.expression.ExpressionManager

    public boolean expectException(Throwable t, MuleEvent event)
    {

        if (!StringUtils.isEmpty(expectExceptionThatSatisfies))
        {
            ExpressionManager expressionManager = muleContext.getExpressionManager();
            if (expressionManager.isExpression(expectExceptionThatSatisfies))
            {
                Boolean expressionResult = (Boolean) expressionManager.evaluate(expectExceptionThatSatisfies, event);
                if (!expressionResult)
                {
                    fail("The exception does not match your MEL expression");
                }
                return true;
View Full Code Here

Examples of org.mule.api.expression.ExpressionManager

    public MuleEvent process(MuleEvent event) throws MuleException
    {
        MockEndpointManager manager = (MockEndpointManager) getEndpointManager(event);

        String address = realAddressAsExpression();
        ExpressionManager expressionManager = event.getMuleContext().getExpressionManager();
        if (expressionManager.isValidExpression(address))
        {
            String realAddress = (String) expressionManager.evaluate(address, event);
            OutboundBehavior behavior = manager.getBehaviorFor(realAddress);

            if (behavior == null)
            {
                return realEndpoint.process(event);
View Full Code Here

Examples of org.mule.api.expression.ExpressionManager

        if (bean instanceof ExpressionEvaluator)
        {
            ExpressionEvaluator ee = (ExpressionEvaluator) bean;

            final ExpressionManager expressionManager = muleContext.getExpressionManager();
            if (!expressionManager.isEvaluatorRegistered(ee.getName()))
            {
                expressionManager.registerEvaluator(ee);
            }
        }
        return bean;
    }
View Full Code Here

Examples of org.mule.api.expression.ExpressionManager

    private MessageProcessor enrichmentProcessor;

    public MuleEvent process(MuleEvent event) throws MuleException
    {
        ExpressionManager expressionManager = event.getMuleContext().getExpressionManager();
        MuleMessage enrichmentMessage = enrichmentProcessor.process(RequestContext.setEvent(event))
            .getMessage();

        if (enrichmentMessage != null)
        {
View Full Code Here

Examples of org.mule.api.expression.ExpressionManager

       
    }

    protected Authentication getAuthenticationToken(MuleEvent event) throws UnauthorisedException
    {  
        ExpressionManager expressionManager = event.getMuleContext().getExpressionManager();
       
        Object usernameEval = expressionManager.evaluate(username, event.getMessage());
        Object passwordEval = expressionManager.evaluate(password, event.getMessage());
    
        if (usernameEval == null) {
            throw new UnauthorisedException(CoreMessages.authNoCredentials());
        }
       
View Full Code Here

Examples of org.mule.api.expression.ExpressionManager

        assertEquals("fooValue", result);
    }

    public void testEnrichEvaluateWithManager() throws Exception
    {
        ExpressionManager expressionManager = muleContext.getExpressionManager();
        MuleMessage message = new DefaultMuleMessage("test", muleContext);

        expressionManager.enrich("#[variable:foo]", message, "fooValue");

        // Value required + found
        Object result = expressionManager.evaluate("#[variable:foo]", message);
        assertNotNull(result);
        assertEquals("fooValue", result);

        // Value required + not found (throws exception)
        try
        {
            expressionManager.evaluate("#[variable:fool]", message);
            fail("required value");
        }
        catch (Exception e)
        {
            // Expected
View Full Code Here

Examples of org.mule.api.expression.ExpressionManager

    private final Query query = createQuery(createQueryTemplate(DYNAMIC_SQL_TEXT));

    @Test
    public void resolvesDynamicQuery() throws Exception
    {
        ExpressionManager expressionManager = mock(ExpressionManager.class);
        String staticSqlText = STATIC_SQL_TEXT;
        when(expressionManager.parse(DYNAMIC_SQL_TEXT, muleEvent)).thenReturn(staticSqlText);

        QueryTemplate expectedQueryTemplate = createQueryTemplate(staticSqlText);
        QueryTemplateParser queryTemplateParser = mock(QueryTemplateParser.class);
        when(queryTemplateParser.parse(staticSqlText)).thenReturn(expectedQueryTemplate);
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.