Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you want to see the GSH source to run this yourself, it is printed below


Jexl advice

Jexl javabean property names

It is better to use the getter name than the property name.  JEXL will throw an exception if there is a null and referring to it as property name.

For example, this will return null

Code Block
    ProvisioningGroup provisioningGroup = new ProvisioningGroup();
    
    Map<String, Object> variableMap = new HashMap<String, Object>();
    variableMap.put("provisioningGroup", provisioningGroup);
    
    String result = GrouperUtil.substituteExpressionLanguage("${provisioningGroup.getName()}", variableMap, true, false, false);
    
    System.out.println(result);

But this will throw an error

Code Block
    ProvisioningGroup provisioningGroup = new ProvisioningGroup();
    
    Map<String, Object> variableMap = new HashMap<String, Object>();
    variableMap.put("provisioningGroup", provisioningGroup);
    
    String result = GrouperUtil.substituteExpressionLanguage("${provisioningGroup.name}", variableMap, true, false, false);
    
    System.out.println(result);


See Also

Grouper ABAC Script Analysis