JacksonJsonNode - mapTo method


#1

I’m not sure whether I address my question/suggestion in proper place. I face with a problem when using mapTo method when mapping input variables between tasks. Basically I save a JSON collection into process variable and then try extract a part of it as a List. I used following formula for this purpose:
${myVal.prop("list").mapTo("java.util.List")}
During run time this expression is calculated using BeanELResolver class which simply try extract method name (mapTo) using reflection. The problem I face with is that JacksonJsonNode overrides this method 3 times:

public <C> C mapTo(Class<C> type)
public <C> C mapTo(String type)
public <C> C mapTo(JavaType type)

and BeanELResolver.findMethod just compares (besides method name) number of requested parameters with number of formal method parameters (in each case we have 1). This means that sometimes BeanELResolver.findMethod pick up first method, sometimes 2nd and sometimes 3rd. Could you make mapTo methods unambiguous e.g. by changing names to mapToClass, mapTo, mapToType in order to remove findMethod results ambiguity ?


#2

Hi @Kikol
May we know where did you use this expression?


#3

I use it to set input variable of my User task.