Class ScriptFunctionHelper

java.lang.Object
com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper
Direct Known Subclasses:
ExtensionFunctionImpl, PropertyChangeScript, ScriptAction, ScriptRunner

public abstract class ScriptFunctionHelper extends Object
Helper to consolidate the logic of an extension-function style script that must be compiled the first time before it runs.
  • Field Details

    • signature

      protected final String signature
  • Constructor Details

    • ScriptFunctionHelper

      protected ScriptFunctionHelper(String signature, String userCode)
      Parameters:
      signature - The signature, which is the method name and arguments like "runMe(arg1, arg2)"
      userCode - The user's portion of the runnable code
  • Method Details

    • getLog

      protected LoggerEx getLog()
    • getComponent

      protected abstract PerspectiveElement getComponent()
    • onScriptLibraryChange

      public void onScriptLibraryChange(ScriptLibChangeEvent ignored)
    • getSecurityLevels

      protected com.google.common.collect.ImmutableCollection<SecurityLevelConfig> getSecurityLevels()
    • invoke

      public Optional<org.python.core.PyObject> invoke(org.python.core.PyObject... arguments)
      Returns:
      the return value, if the method was invoked successfully, or empty if a problem was found.
    • invoke

      public Optional<org.python.core.PyObject> invoke(org.python.core.PyObject[] arguments, String[] keywords)
      Returns:
      the return value, if the method was invoked successfully, or empty if a problem was found.
    • getDescription

      protected String getDescription()
      Describe the location/context of this script. Used for error messages
    • getTagReferencePath

      protected abstract PerspectiveTagReferenceLocation getTagReferencePath()
    • logWarn

      protected void logWarn(String message, Throwable error)
    • py2qualified

      public static QualifiedValue py2qualified(org.python.core.PyObject object)