code: public static Map<String, Object> findFreeMarkerContextVariables(Variables variables, String... varNames)
      {
          Map<String, Object> results = new HashMap<>();
  
          for (String varName : varNames)
          {
              WindupVertexFrame payload = null;
              try
              {
                  payload = Iteration.getCurrentPayload(variables, null, varName);
              }
              catch (IllegalStateException | IllegalArgumentException e)
              {
                  // oh well
              }
  
              if (payload != null)
              {
                  results.put(varName, payload);
              }
              else
              {
                  Iterable<? extends WindupVertexFrame> var = variables.findVariable(varName);
                  if (var != null)
                  {
                      results.put(varName, var);
                  }
              }
          }
          return results;
      }
docs: Finds all variables in the context with the given names, and also attaches all WindupFreeMarkerMethods from all addons into the map.
  
  This allows external addons to extend the capabilities in the freemarker reporting system.