use of org.camunda.bpm.engine.impl.javax.el.PropertyNotFoundException in project camunda-bpm-platform by camunda.
the class AstIdentifier method setValue.
public void setValue(Bindings bindings, ELContext context, Object value) {
ValueExpression expression = bindings.getVariable(index);
if (expression != null) {
expression.setValue(context, value);
return;
}
context.setPropertyResolved(false);
context.getELResolver().setValue(context, null, name, value);
if (!context.isPropertyResolved()) {
throw new PropertyNotFoundException(LocalMessages.get("error.identifier.property.notfound", name));
}
}
use of org.camunda.bpm.engine.impl.javax.el.PropertyNotFoundException in project camunda-bpm-platform by camunda.
the class JuelExpression method getValue.
public Object getValue(VariableScope variableScope, BaseDelegateExecution contextExecution) {
ELContext elContext = expressionManager.getElContext(variableScope);
try {
ExpressionGetInvocation invocation = new ExpressionGetInvocation(valueExpression, elContext, contextExecution);
Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(invocation);
return invocation.getInvocationResult();
} catch (PropertyNotFoundException pnfe) {
throw new ProcessEngineException("Unknown property used in expression: " + expressionText + ". Cause: " + pnfe.getMessage(), pnfe);
} catch (MethodNotFoundException mnfe) {
throw new ProcessEngineException("Unknown method used in expression: " + expressionText + ". Cause: " + mnfe.getMessage(), mnfe);
} catch (ELException ele) {
throw new ProcessEngineException("Error while evaluating expression: " + expressionText + ". Cause: " + ele.getMessage(), ele);
} catch (Exception e) {
throw new ProcessEngineException("Error while evaluating expression: " + expressionText + ". Cause: " + e.getMessage(), e);
}
}
use of org.camunda.bpm.engine.impl.javax.el.PropertyNotFoundException in project camunda-bpm-platform by camunda.
the class ExpressionBeanAccessTest method testConfigurationBeanAccess.
@Deployment
public void testConfigurationBeanAccess() {
// Exposed bean returns 'I'm exposed' when to-string is called in first service-task
ProcessInstance pi = runtimeService.startProcessInstanceByKey("expressionBeanAccess");
assertEquals("I'm exposed", runtimeService.getVariable(pi.getId(), "exposedBeanResult"));
// is not added to the beans-list
try {
runtimeService.signal(pi.getId());
fail("Exception expected");
} catch (ProcessEngineException ae) {
assertNotNull(ae.getCause());
assertTrue(ae.getCause() instanceof PropertyNotFoundException);
}
}
use of org.camunda.bpm.engine.impl.javax.el.PropertyNotFoundException in project camunda-bpm-platform by camunda.
the class AstIdentifier method eval.
@Override
public Object eval(Bindings bindings, ELContext context) {
ValueExpression expression = bindings.getVariable(index);
if (expression != null) {
return expression.getValue(context);
}
context.setPropertyResolved(false);
Object result = context.getELResolver().getValue(context, null, name);
if (!context.isPropertyResolved()) {
throw new PropertyNotFoundException(LocalMessages.get("error.identifier.property.notfound", name));
}
return result;
}
use of org.camunda.bpm.engine.impl.javax.el.PropertyNotFoundException in project camunda-bpm-platform by camunda.
the class AstIdentifier method isReadOnly.
public boolean isReadOnly(Bindings bindings, ELContext context) {
ValueExpression expression = bindings.getVariable(index);
if (expression != null) {
return expression.isReadOnly(context);
}
context.setPropertyResolved(false);
boolean result = context.getELResolver().isReadOnly(context, null, name);
if (!context.isPropertyResolved()) {
throw new PropertyNotFoundException(LocalMessages.get("error.identifier.property.notfound", name));
}
return result;
}
Aggregations