Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MVEL variables throw PropertyAccessException unresolvable property or identifier after upgrade #395

Open
aquacode opened this issue Sep 12, 2022 · 1 comment

Comments

@aquacode
Copy link

I followed the v3 --> v4 upgrade instructions and all mvel yaml file rules compile and most run fine. However, a few are throwing errors in the actions when attempting to access variables (seems the ctx is null and the variable can't be accessed).

Is there another step in the version upgrade? Most of our variables are Optionals that we use get(), isPresent, and orElse functions on.

Here's a sample code that worked on 3.3 but fails on 4.1:

---
name: "zzz_custom"
condition: >
  parameterValues = config.get('parameters');
  parameterValues.isPresent();
actions:
  - >
    for(rule:parameterValues.get()){
      if(rule.match==true){
        for(mod:rule.fields.entrySet()){
          org.apache.commons.beanutils.BeanUtils.copyProperty(callParameters,mod.key,mod.value);
        }
      }
    }

The error occurs in the actions on the line trying to access parameterValues.get() with PropertyAccessException.
If I insert this call parameterValues = config.get('parameters'); then it works.

I have other mvel yaml files that are having a similar problem, but so far, I've not been able to solve it simply by re-initializing the variable like above.

@dvgaba
Copy link

dvgaba commented Sep 14, 2022

I will be great if you can share a maven repo with a sample

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants