code: public static ExecutableScript getScriptFromResource(String language, String resource, ExpressionManager expressionManager, ScriptFactory scriptFactory) {
      ensureNotEmpty(NotValidException.class, "Script language", language);
      ensureNotEmpty(NotValidException.class, "Script resource", resource);
      if (isDynamicScriptExpression(language, resource)) {
        Expression resourceExpression = expressionManager.createExpression(resource);
        return getScriptFromResourceExpression(language, resourceExpression, scriptFactory);
      }
      else {
        return getScriptFromResource(language, resource, scriptFactory);
      }
    }
docs: Creates a new {@link ExecutableScript} from a resource. It excepts static and dynamic resources.
  Dynamic means that the resource is an expression which will be evaluated during execution.
  
  @param language the language of the script
  @param resource the resource path of the script code or an expression which evaluates to the resource path
  @param expressionManager the expression manager to use to generate the expressions of dynamic scripts
  @param scriptFactory the script factory used to create the script
  @return the newly created script
  @throws NotValidException if language or resource are null or empty