use of com.walmartlabs.concord.runtime.v2.runner.el.MethodNotFoundException in project concord by walmartlabs.
the class TaskMethodResolver method invoke.
@Override
public Object invoke(ELContext elContext, Object base, Object method, Class<?>[] paramTypes, Object[] params) {
Step step = context.execution().currentStep();
if (!(step instanceof Expression) || !(base instanceof Task) || !(method instanceof String)) {
return null;
}
String taskName = getName(base);
if (taskName == null) {
return null;
}
CallContext callContext = TaskCallInterceptor.CallContext.builder().taskName(taskName).correlationId(context.execution().correlationId()).currentStep(step).processDefinition(context.execution().processDefinition()).build();
TaskCallInterceptor interceptor = context.execution().runtime().getService(TaskCallInterceptor.class);
try {
return interceptor.invoke(callContext, Method.of(base, (String) method, Arrays.asList(params)), () -> super.invoke(elContext, base, method, paramTypes, params));
} catch (javax.el.MethodNotFoundException e) {
throw new MethodNotFoundException(base, method, paramTypes);
} catch (javax.el.ELException e) {
if (e.getCause() instanceof RuntimeException) {
throw (RuntimeException) e.getCause();
}
throw e;
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations